php 5.0.4
mySQL 4.1.11a
I need to store the most recent query for each user when using a particular php script. The following works:
and puts the string 'whatever' into the pwdQueryAddress field of the table.Code:$session_userid = $_SESSION['userid']; $newquery = "update password_table set pwdQueryAddress = 'whatever' where pwdLoginId = '$session_userid'";
But what I really want, of course, is:
Which gives mySQL fits because it treats $query as part of the update statement, not as text.Code:$query = "select * from address, name where adrAddressId > 0 and adrAddressId = namAddressId and adrDoNotCall like '$searchvalues[2]' and adrStreetNumber like '$searchvalues[3]' and adrStreetName like '$searchvalues[4]' and adrUnitNumber like '$searchvalues[5]' and adrZipCode like '$searchvalues[6]' and adrPrecinct like '$searchvalues[7]' and adrWard like '$searchvalues[8]'"; $newquery = "update password_table set pwdQueryAddress = '$query' where pwdLoginId = '$session_userid'";
What's the delimiter I need aroudn '$query' to make mySQL treat it like common everyday characters?
-Thx
-MagicT




Reply With Quote