<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->$MYSQLDB = mysql_connect("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());<br />Â Â mysql_select_db("SLVProspectsTest");<br />Â Â <br />Â Â $inEmail = trim($_POST["EmailAddress"]);<br />Â Â $query = "SELECT EmailAddress, UsrHash, AddressID FROM tblAddresses WHERE EmailAddress = '$inEmail'";<br />Â Â // run the query<br />Â Â $qryResult = mysql_query($query);<br />Â Â $qryNumRows = mysql_num_rows($qryResult);<br />Â Â // Add Auditing information to DB<br />Â Â $query = "INSERT INTO tblWebLogons (EmailAddress,DateLogon,Action) VALUES('$inEmail','$dtStamp','Successful Logon')";<br />Â Â // run the query<br />Â Â $qryResult = mysql_query($query);<br />Â Â mysql_close($MYSQLDB);<!--c2--></div><!--ec2--><br /><br />The situation is that I have two databases on the account:<br />SLVProspectsTest<br />SLVProspects<br /><br />Test being naturally my test data set and the other being the live data. So while I'm typing away today I see that the listed code is SELECTing from SLVProspects and INSERTing into SLVProspectsTest, not a good thing! <br /><br />Key Info: The two databases have the same username and password.<br /><br />Naturally my goal is to have PHP and MySQL use the database in the mysql_select_db() call and only that database. Any help and insight is greatly appreciated.<!--content-->
Never mind, thanks to a handy grouping feature I missed the second record that was making it appear data was coming from the wrong database (when it was actually coming from the correct DB).<!--content-->
Glad you have it sorted out.<!--content-->
Never mind, thanks to a handy grouping feature I missed the second record that was making it appear data was coming from the wrong database (when it was actually coming from the correct DB).<!--content-->
Glad you have it sorted out.<!--content-->