Page 1 of 1

Simple MySQL Query Syntax Issue

Posted: Thu May 21, 2009 9:11 am
by sirstrumalot
I'm trying to set this but I must be messing up the syntax on the variable ($row_userinfo['user_ProviderName']) Any ideas?

The message I get is:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

Code: Select all

mysql_select_db($database_contacts, $missed_visits);
$query_missed_visits = "SELECT * FROM missedVisit WHERE missed_provider = ".$row_userinfo['user_providerName']." $sorder";
$missed_visits = mysql_query($query_missed_visits, $missed_visits) or die(mysql_error());

Re: Simple MySQL Query Syntax Issue

Posted: Thu May 21, 2009 9:38 am
by jaoudestudios
Whats in $sorder?

Show us the final query (after php) and we can adjust it as required, then you can play with php to auto gen it

Re: Simple MySQL Query Syntax Issue

Posted: Thu May 21, 2009 9:42 am
by Eran
user_providerName is probably a string and needs to be quoted