Question for (Browser) Mysql - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Other (
https://sampforum.blast.hk/forumdisplay.php?fid=7)
+--- Forum: Everything and Nothing (
https://sampforum.blast.hk/forumdisplay.php?fid=23)
+--- Thread: Question for (Browser) Mysql (
/showthread.php?tid=586160)
Question for (Browser) Mysql -
nezo2001 - 19.08.2015
As I can't find any forum like ours for mysql and sql statments for browser I want any help here please
Код:
Parse error: syntax error, unexpected 'SELECT' (T_STRING)
This is line 10
PHP код:
$dCheckU = mysqli_query($conn, "SELECT * FROM users WHERE username='".$user."'");
I can't find the problem
Re: Question for (Browser) Mysql -
gtakillerIV - 19.08.2015
Your syntax is wrong, it should be the opposite. Query first then the connection handle.
Edit: Whoops, actually it's correct. Are you sure it's the line that is giving you the error? Maybe show us a bit more of your code please.
Re: Question for (Browser) Mysql -
Potassium - 20.08.2015
It's usually a missing, or incorrectly placed, character. Please show us some more code because I don't think that's the line that is causing the error.
Re: Question for (Browser) Mysql -
lolumadd_ - 20.08.2015
You most likely have an extra or missing " or ' somewhere upwards in your code. It's also a good habit to escape your quotations within your strings, even when they differentiate between " & '.
e.g:
PHP код:
$dCheckU = mysqli_query($conn, "SELECT * FROM `users` WHERE `username`='".$user."' LIMIT 1");
Re: Question for (Browser) Mysql -
Calgon - 20.08.2015
Quote:
Originally Posted by lolumadd_
`username`=\'".$user."\' LIMIT 1
|
Brilliant job mate.
Re: Question for (Browser) Mysql -
lolumadd_ - 20.08.2015
Quote:
Originally Posted by Calgon
Brilliant job mate.
|
Lol. Okay, I see this was completely wrong now. Sorry for false advice mate.
Re: Question for (Browser) Mysql -
nezo2001 - 20.08.2015
Okay, I found wrong (") at the connecting line xD
I don't know WTF with me