Error 1064 in PHP and MYSQLI while using select

Karim1504

New Member
Basically I'm trying to check if a table exists. Here is the relevant portion of my code of my code.\[code\]$con=mysqli_connect("localhost", 'root', '');mysqli_select_db($con, "user");mysqli_query($con, "select 1 from a123456");echo mysqli_errno($con);if(mysqli_errno($con) == 0){}\[/code\]a123456 is a table which does exist. I know 1064 means syntax error but I can't figure out why. I ran the same query \[code\] use user; select 1 from a123456\[/code\]on phpmyadmin and it worked fine. If I comment out the \[code\] mysqli_query($con, "select 1 from a123456");\[/code\]line it doesn't throw any errors. Sorry for the noob question and I hope(and did check quite a bit)that this isn't a duplicate.
 
Back
Top