note 3094 deleted from mysql_pconnect by danbeck
| From: | danbeck@php.net | Date: | Thu, 07 Sep 2000 17:12:18 +0000 |
| Subject: | note 3094 deleted from mysql_pconnect by danbeck | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-4412@lists.php.net to get a copy of this message | ||
Here's a short example. say you had a small mysql table with Name and Phone fields in a table
called phonenums in a database called info.
$my_pconn = mysql_pconnect("localhost", "root", "sex");
$my_results = mysql_db_query("info", "select * from phonenums", $my_pconn);
while($phoneinfo = mysql_fetch_array($my_results)) {
echo "$phoneinfo[Name] 's phone number is $phoneinfo[Phone]<br>";
}
or say you passed a cgi var of $new_num into a php3 script to update someones number
$update_attempt = mysql_db_query("info", "update phonenum set Phone =
'$new_num' where Name = 'Bob'", $my_pconn);
Hope this helps