Jump to content

SQL Syntax error...


lesolemph

Recommended Posts

trying to select from table and i get this 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 'table' at line 1"

 

pliz help

 

<?php
$con=@mysql_connect('localhost','root','');
if(!$con)
{
die('Could not connect:'.mysql_error());
}
mysql_select_db("database",$con)or die('Could not find db:'.mysql_error());

	        $sql = @mysql_query("SELECT * FROM table ") or die (
		mysql_error());

		$row = mysql_fetch_array($sql);

		echo $row['info'];	
					  
		?>

 

my database name = "database"

table = "table"

 

      info

information

 

 

my table has only one field "info" with only one row... please help

Link to comment
https://forums.phpfreaks.com/topic/212875-sql-syntax-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.