RE: [PHP] MySQL question

From: Date: Sun, 21 Apr 2002 22:16:41 +0000
Subject: RE: [PHP] MySQL question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-93912@lists.php.net to get a copy of this message
In brief, and in no way finished (no error trapping, commenting, etc)... <? $db = mysql_connect("localhost", "root"); mysql_select_db("test",$db); $result = mysql_query("SELECT CountryID, CountryName FROM tblcountries",$db); echo "<table border=1>\n"; echo " <tr>\n"; echo " <td>CatNumber</td>\n"; echo " <td>Title</td>\n"; echo " </tr>\n"; while ($myrow = mysql_fetch_row($result)) { echo "<tr>\n"; echo " <td>$myrow[0]</td>\n"; echo " <td>$myrow[1]</td>\n"; echo "</tr>\n"; } echo "</table>\n"; ?> hth, .ben > -----Original Message----- > From: Mantas Kriauciunas [mailto:Mantuks@attbi.com] > Sent: 22 April 2002 01:07 > To: PHP General List > Subject: [PHP] MySQL question > > > Hey PHP General List, > > Amm... can anybody point me to some good tutorial that talks about > SELECT from detabase? what i need is ... like i have table with lots > of rows.... and i need to output them all to the page... it goes > like most of news sections in the page... thanks for help. > (i need to learn more about SELECT'ing things from database) > > :------------------------------: > Have A Nice Day! > Mantas Kriauciunas A.k.A mNTKz > > Contacts: > Mantuks@attbi.com > Http://mntkz-hata.visiems.lt > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#93912) next »