How does php query a field
This article will explain in detail how to query a certain field in php, Xiaobian thinks it is quite practical, so share it with you as a reference, I hope you can gain something after reading this article.
Php query a field method: 1, through the "select * from" statement query data;2, through the "$student_value <$'period '];" way to read the value;3, through the "echo $period;" way to output the query results.
Operating environment: Windows 7, PHP 7.1, Dell G3
How does PHP query a field?
php returns a field of query results
The code is as follows:
global $mysql;//query $sql = "select * from `bookTable` where student_id = '".$ student_id. "'"; $student_value = $mysql->getLine( $sql ); $period = $student_value['period']; $state = $student_value ['state '];//Output echo $period;
or
$sql = "SELECT * FROM `cabinet` WHERE state_M =0 LIMIT 0 , 1"; $data = $mysql->getData( $sql ); $cabinet_id = $data[0]['cabinet_id']; About "php how to query a field" This article is shared here, I hope the above content can be of some help to everyone, so that you can learn more knowledge, if you think the article is good, please share it to let more people see.