note 7660 added to mysql_db_query
| From: | nevrar at mukau dot net | Date: | Thu, 10 Aug 2000 16:39:50 +0000 |
| Subject: | note 7660 added to mysql_db_query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-775@lists.php.net to get a copy of this message | ||
After enormous hassle and contradictory documentation (yes, on php.net!), I have success with the
following sequence of commands...
$link = mysql_pconnect("localhost", "nameofdatabase", "password");
$sql = "select * from whatever;";
$result = mysql_db_query(dbname(), $sql, $link);
//then you can do something like:
while ($row=mysql_fetch_array($result))
print ($row['columnname']);
http://www.php.net/manual/function.mysql-db-query.php