Printing result of mysql query from variable

后端 未结 4 1976
日久生厌
日久生厌 2021-02-07 15:58

So I wrote this earlier (in php), but everytime I try echo $test\", I just get back resource id 5. Does anyone know how to actually print out the mysql query from the variable?<

4条回答
  •  失恋的感觉
    2021-02-07 16:50

    From php docs:

    For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.

    For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error.

    The returned result resource should be passed to mysql_fetch_array(), and other functions for dealing with result tables, to access the returned data.

    http://php.net/manual/en/function.mysql-query.php

提交回复
热议问题