This piece of code produces it:
$result=mysql_query($query); echo $result;
It shows Resource...
because it has a resource type, itβs just a kind of special handler for the request, it doesnβt look like a regular type (string or int for example), so it has nothing to read for printing. A.
If you want to print data from a query, you must first extract it.
Also note that those mysql_*
functions are mysql_*
; they are not recommended for use. Note from php manual:
Using this extension is not recommended. Instead, MySQLi or PDO_MySQL should use the extension. See Also MySQL: Choosing an API Guide and Frequently Asked Questions for more information. Alternatives to this feature include:
mysqli_query ()
PDO :: request ()
source share