Jump to content
MakeWebGames

Cant figure this error out


JohnGato

Recommended Posts

Can anyone help me this error

 

QUERY ERROR: 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

Query was SELECT view FROM users WHERE userid=

 

cant figure it out

Thanks for any help

Link to comment
Share on other sites

OK got that fixed now im getting this error

QUERY ERROR: 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 'AND magColumn='1' AND magVisible='yes'' at line 1

Query was SELECT magID,magLocation,magText FROM newsMagazine WHERE magLocation= AND magColumn='1' AND magVisible='yes'

 

here is the line of code:

 

$rm1=$db->fetch_row($db->query("SELECT magID,magLocation,magText FROM newsMagazine WHERE magLocation={$ir['location']} AND magColumn='1' AND magVisible='yes'"));
$rm2=$db->fetch_row($db->query("SELECT magID,magLocation,magText FROM newsMagazine WHERE magLocation={$ir['location']} AND magColumn='2' AND magVisible='yes'"));

 

 

Thank for any help... really appreciate it

Link to comment
Share on other sites

Your error is the end of

magLocation=

the error...

{$ir['location']}

As bineye stated you may have not defined it... most likely that is the problem...

OR it may be that $ir does not go there at all, what query are you pulling the ['location'] from? it could be you did not add the correct $var... such as this example...

$var=query selecting ['location']

$location=$db->fetch_row($var);

it would then be $location['location'] instead of $ir...

You have not included a lot of info from those very few lines...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...