php 返回查询结果某个字段

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/u011385799/article/details/50479849

    global $mysql;

//查询

    $sql = "select * from `bookTable` where student_id = '".$student_id."'";

    $student_value = $mysql->getLine( $sql );

//读值

    $period = $student_value['period'];

    $state = $student_value['state'];

//输出

    echo $period;


或者

   $sql = "SELECT * FROM  `cabinet` WHERE state_M =0 LIMIT 0 , 1";

   $data = $mysql->getData( $sql );

   $cabinet_id = $data[0]['cabinet_id'];


展开阅读全文

没有更多推荐了,返回首页