Can anyone advise on how to surround a string variable in a query. I select
a string code from a column using:
$result = mysql_query("SELECT * FROM $TA WHERE Profileid = '$profileid'");
$row = mysql_fetch_array($result);
I then want to extract from a second table an id that relates to the code
from the first query. I've tried various combinations of:
$result = mysql_query("select Primaryid from primarycodes where Code =
'$row[Primaryexpertise]'")
with =, ==, ===, ', \", but always get a syntax error. I can get it to
work with LIKE as follows:
$result = mysql_query("select Primaryid from primarycodes where Code like
'%$row[Primaryexpertise]%'")
but I need greater accuracy because some codes contain similar data. String
manipulation has me baffled most of the time!
Thanks.
Mick Lloyd
[EMAIL PROTECTED]
Tel: +44 (0)1684 560224
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]