database hell
| From: | Nick Edwards | Date: | Thu, 12 Jul 2012 11:29:59 +0000 |
| Subject: | database hell | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-318434@lists.php.net to get a copy of this message | ||
Hi
We have a program that manages users, throughout all database calls
created as:
$connect = mysql_connect($db_host--other variables);
mysql_query("Delete from clients where id=$User");
All this works good, but, we need, in the delete function to delete
from another database
$connmy=mysql_connect("host","user","pass");
mysql_select_db("vsq",$connmy);
mysql_query("DELETE from userprefs where clientr='$User'");
$mysql_close($connmy);
this fails, unless we use a mysql_close prior to it, and then
reconnect to original database after we run this delete, how can we
get around this without closing and reopening?
We have a perl script doing similar for manual runs, and it works
well knowing that $connmy is not $connect, I'm sure there is a simple
way to tell php but I'm darned if I can see it.
Thanks
Niki