I connect to database "one", and my queries work great. Then I close the connection and connect to database "two", but now all of my queries are producing errors because they are asking for one.table instead of two.table NOTE: I have changed the database names, and cut out irrelevant code:
/* Connect to database two - this works fine */
$db = mysql_connect("localhost", "user", "pass");
mysql_select_db("one",$db);
/* Query db one - this works fine */
$query = "SELECT * FROM users";
$result = mysql_query($query);
$num = mysql_numrows($result);
$i=0;
while ($i < $num) {
...
++$i;
}
...
mysql_close();
/* Connect to database two - this doesn't produce errors */
$db = mysql_connect("localhost", "user", "password");
mysql_select_db("dbtwo",$db);
/* Query db two - produces error "Table 'one.serv' doesn't exist" WHY IS IT CALLING DB ONE? Please help*/
$query = "SELECT * FROM serv";
$result = mysql_query($query);
$num = mysql_numrows($result);
I changed the password to make sure that I was indeed connecting to db two, and I got "not connected to db errors, so I am connecting. Why is it still calling db one after my new select statement? Thank you for your time and attention.


