Printing result of mysql query from variable

后端 未结 4 2018
日久生厌
日久生厌 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:43

    $sql = "SELECT * FROM table_name ORDER BY ID DESC LIMIT 1";
    $records = mysql_query($sql);
    

    you can change LIMIT 1 to LIMIT any number you want

    This will show you the last INSERTED row first.

提交回复
热议问题