note 22569 added to ref.mysql
| From: | bbd at galati dot astral dot ro | Date: | Sun, 23 Jun 2002 01:25:03 +0000 |
| Subject: | note 22569 added to ref.mysql | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-32119@lists.php.net to get a copy of this message | ||
The shortest way to execute a MySQL query in PHP is by using the mysql function.
Example:
<?php
$conn=mysql_connect("$dbhost","$dbuser","$dbpass");
$result=mysql("$dbname","$dbquery");
mysql_close($conn);
?>
This way you can work directly with multiple databases.
--
http://www.php.net/manual/en/ref.mysql.php
http://master.php.net/manage/user-notes.php?action=edit+22569
http://master.php.net/manage/user-notes.php?action=delete+22569
http://master.php.net/manage/user-notes.php?action=reject+22569