Venom Posted April 6, 2003 Report Share Posted April 6, 2003 Kaut kā te patukši izskatās. Nolēmu iepostēt linku uz vienu no klasēm, kuru es izmantoju ikdienā. Ja kādam papildinājumi/uzlabojumi - very welcome! http://venom.times.lv/vm.mysql.php Link to comment Share on other sites More sharing options...
Roze Posted April 9, 2003 Report Share Posted April 9, 2003 Manupraat logjiski ir rakstiit kaut kadu unikalaaku klasi t.i. ar supportu vairaakaam db (pgsql, ms sql, oracle) jo diezvai ir jedzigi izmantot mysql_connect vietaa piemeeram db_con().. Link to comment Share on other sites More sharing options...
jb4 Posted April 11, 2003 Report Share Posted April 11, 2003 Man bija slinkums kaut ko ielaadeet un skatiities, bet db_conn() lietoshana mysql_connect() vietaa tiek saukta par abstrakciju un pie citas db vienkarshi tiks uzrakstiita sav db_conn() f-ja. <code><font color="#000000"> <font color="#0000CC"><?php </font><font color="#006600">class </font><font color="#0000CC">AbstractDatabase </font><font color="#006600">{ </font><font color="#0000CC">metodes</font><font color="#006600">, </font><font color="#0000CC">kas kopīgas visām DB </font><font color="#006600">} </font><font color="#0000CC">?></font> </font> </code> failaa mysql.php piemeram: <code><font color="#000000"> <font color="#0000CC"><?php </font><font color="#006600">class </font><font color="#0000CC">Database </font><font color="#006600">extends </font><font color="#0000CC">AbstractDatabase </font><font color="#006600">{ </font><font color="#0000CC">metodes</font><font color="#006600">, </font><font color="#0000CC">kas raksturiigas tikai MySQL db db_conn</font><font color="#006600">() </font><font color="#0000CC">prieksh MySQL</font><font color="#006600">, </font><font color="#0000CC">db_query</font><font color="#006600">() </font><font color="#0000CC">prieksh MySQL </font><font color="#006600">... } </font><font color="#0000CC">?></font> </font> </code> failaa postgresql.php: <code><font color="#000000"> <font color="#0000CC"><?php </font><font color="#006600">class </font><font color="#0000CC">Database </font><font color="#006600">extends </font><font color="#0000CC">AbstractDatabase </font><font color="#006600">{ </font><font color="#0000CC">metodes</font><font color="#006600">, </font><font color="#0000CC">kas raksturiigas tikai PostgreSQL db db_conn</font><font color="#006600">() </font><font color="#0000CC">prieksh PostgreSQL</font><font color="#006600">, </font><font color="#0000CC">db_query</font><font color="#006600">() </font><font color="#0000CC">prieksh PostgreSQL </font><font color="#006600">...} } </font><font color="#0000CC">?></font> </font> </code> <code><font color="#000000"> <font color="#0000CC"><?php $dbtype </font><font color="#006600">= </font><font color="#CC0000">'postgresql'</font><font color="#006600">; include(</font><font color="#0000CC">$dbtype</font><font color="#006600">.</font><font color="#CC0000">'.php'</font><font color="#006600">); </font><font color="#0000CC">$db </font><font color="#006600">= new </font><font color="#0000CC">Db</font><font color="#006600">(); ... </font><font color="#0000CC">$result </font><font color="#006600">= </font><font color="#0000CC">$db</font><font color="#006600">-></font><font color="#0000CC">db_query</font><font color="#006600">(</font><font color="#CC0000">"SELECT ME"</font><font color="#006600">); ... if (</font><font color="#0000CC">$numrows </font><font color="#006600">= </font><font color="#0000CC">$db</font><font color="#006600">-></font><font color="#0000CC">getNumRows</font><font color="#006600">(</font><font color="#0000CC">$result</font><font color="#006600">)) ... </font><font color="#0000CC">?></font> </font> </code> Link to comment Share on other sites More sharing options...
SpiegS Posted July 30, 2003 Report Share Posted July 30, 2003 Manupraat logjiski ir rakstiit kaut kadu unikalaaku klasi t.i. ar supportu vairaakaam db (pgsql, ms sql, oracle)jo diezvai ir jedzigi izmantot mysql_connect vietaa piemeeram db_con().. arii taadas jau ir dabunamas gatavas - taa ka nav jeegas divriteni no jauna izgudrot ;) . es piemeeram izmandoju <a href="http://php.weblogs.com/ADOdb">ADODB</a>. IMHO ljoti laba klase Link to comment Share on other sites More sharing options...
3ps Posted July 30, 2003 Report Share Posted July 30, 2003 ADOdb ir simt nevajadzīgiem sūdiem piebāzts pūslis, uzraksti pa piecpadsmit minūtēm sev tādu pašu un aidā. ADOdb pamatīgi iebremzē pasākumu. Link to comment Share on other sites More sharing options...
Roze Posted August 2, 2003 Report Share Posted August 2, 2003 arii taadas jau ir dabunamas gatavas - taa ka nav jeegas divriteni no jauna izgudrot ;) . es piemeeram izmandoju <a href="http://php.weblogs.com/ADOdb">ADODB</a>. IMHO ljoti laba klase Es neteicu ka taadas nav pieejamas (nosauc kaut 3 lietas kas nav jau reiz uzrakstiitas vai kaut kur nepiedaavaajas ieksh php), tas bija mans komentaars attieciibaa tieshi uz sho klasi un ideju kopumaa.. Link to comment Share on other sites More sharing options...
Recommended Posts