brain cramp, ouch!

From: Date: Fri, 17 May 2002 18:28:50 +0000
Subject: brain cramp, ouch!
Groups: php.general 
Request: Send a blank email to php-general+get-98165@lists.php.net to get a copy of this message
Ok Let's say I'm querying a table, and looping thru the results: $connect=mysql_connect(host,user,pass); $thedb=mysql_select(database1); $thequery="select * from foo"; $theresult=mysql_query($thequery) or die (mysql_error()) while ($output=mysql_fetch_assoc($theresult)){ do stuff here.. } What if while I'm looping, I want to take the information I'm looping thru, and want to write it to completely different database, assuming that the same username and password info works for both databases? Would you use multiple mysql_select_db statements, and then make refer. to the result of that select in your queries? I'm getting errors when I do that. Sorry to be so moronical, K Do I define

« previous php.general (#98165) next »