//$sql = "DESCRIBE ".$table;
$sql = "DESCRIBE '$table' ";
$result = $con->query($sql);
$resultarray=$result->fetchAll();
I would like to know why using SQL statement in line 2
$sql = "DESCRIBE '$table' ";
does not execute properly and results in the error;
"Fatal error: Call to a member function fetchAll() on a non-object in.."
shown on the last line of the paste whereas SQL statement in line 1
$sql = "DESCRIBE ".$table;
executes just fine.
I am using Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1 in XAMPP
and MySQL Server version: 5.5.16
P.S. From what I v been reading I am aware that I probably should be using PDO prepare/execute statements for SQL with parameters...