Jump to content
MakeWebGames

Recommended Posts

Posted

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

Posted

Its probably because you have 0 users in your database. If you haven't go a single user in the database it will throw that error. I got stuck in that same situation once upon a time...

Posted

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

Posted

The problem is the $ir global hasn't been defined before, hence it returning a blank error. You need to include the globals file, then use global $ir.

Posted

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...

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...