大橙子网站建设,新征程启航
为企业提供网站建设、域名注册、服务器等服务
$form=M('user');
成都服务器托管,创新互联提供包括服务器租用、成都服务器托管、带宽租用、云主机、机柜租用、主机租用托管、CDN网站加速、域名与空间等业务的一体化完整服务。电话咨询:13518219792
$result=$form-where(array('username'=''))-select();
// 下面就是打印这条sql语句的方法
$form-getLastSql();
你好,一共有两种方法可以打印sql语句,具体实现方法可参照这篇文章:
ThinkPHP5打印sql语句
[ SQL ] SHOW COLUMNS FROM `think_action` [ RunTime:0.001339s ]
[ EXPLAIN : array ( 'id' = '1', 'select_type' = 'SIMPLE', 'table' = 'think_action', 'partitions' = NULL, 'type' = 'ALL', 'possible_keys' = NULL, 'key' = NULL, 'key_len' = NULL, 'ref' = NULL, 'rows' = '82', 'filtered' = '100.00', 'extra' = NULL, ) ]
[ SQL ] SELECT * FROM `think_action` LIMIT 1 [ RunTime:0.000539s ]
?php
$db_host='localhost';
$db_name='test123';
$db_user='test123';
$db_psd='test123';
mysql_connect($db_host,$db_user,$db_psd);
mysql_select_db($db_name);
$sql="select * from `group`";
$res=mysql_query($sql);
if($resmysql_num_rows($res)0){
$row=mysql_fetch_assoc($res);
}
echo ($row['title']);
?