This should work ...
$result=mysql_query(SELECT book FROM TAB_AUTHORS WHERE aid = '$aid');
When PHP sees the single quotes around the $aid it evaluates it to the
value stored in the variable.
Your first example connntained $aid within a set of double quotes, thus it
was treated as a literal.
I see your question has already been answered, but I'll add a tip that works
well for me. Whenever I want to perform an SQL query that involves PHP
variables I will write the query string to its own variable instead of
directly into the function. Then use that variable in the query
function...
Am Wed, 12.Dec 2001 um 10:22 schrieb Miles Thompson:
This should work ...
$result=mysql_query(SELECT book FROM TAB_AUTHORS WHERE aid = '$aid');
When PHP sees the single quotes around the $aid it evaluates it to the
value stored in the variable.
Your first example connntained $aid within
3 matches
Mail list logo