hi.i have got a problem.
Parse error: syntax error, unexpected T_VARIABLE in c:\wamp\www\dynamic2.php on line 12
for the line:
$result=mysql_query("select company from dynamic where id="$id) or die(mysql_error());
if anyone help me,i will be greatful.
syntax error in function argument
mysql_query("sql" . $var)
don’t forget to sanitize your input!
1. Try using code tags next time
2. Try changing the code to:
$result=mysql_query("select company from dynamic where id=$id") or die(mysql_error());
I have brought the variable inside the string.
Mushfiq, to date you have named every thread you have started Dynamic Link. This explains nothing of the problem in this thread. We expect you to provide a meaningful title as it helps others who are searching the forum with the same problem.
Please take note of this as I have already warned you for not using code tags (and you have failed to do so again).
Read Posting Guidelines.
change the code to
$result=mysql_query("select company from dynamic where `id`="$id) or die(mysql_error());
@divyac this will result in the same error (for exactly the same reasons) plus the quotation marks are in the wrong place
for some basics on strings read this
To all concerned it’s called ‘concatenation’.