Question for (Browser) Mysql
#1

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
Reply
#2

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.
Reply
#3

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.
Reply
#4

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"); 
Reply
#5

Quote:
Originally Posted by lolumadd_
Посмотреть сообщение
`username`=\'".$user."\' LIMIT 1
Brilliant job mate.
Reply
#6

Quote:
Originally Posted by Calgon
Посмотреть сообщение
Brilliant job mate.
Lol. Okay, I see this was completely wrong now. Sorry for false advice mate.
Reply
#7

Okay, I found wrong (") at the connecting line xD
I don't know WTF with me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)