你好,一共有兩種方法可以打印sql語(yǔ)句,具體實(shí)桐羨攜現(xiàn)方法局伏可參照這篇文章:
創(chuàng)新互聯(lián)是一家專(zhuān)注于網(wǎng)站制作、成都網(wǎng)站建設(shè)與策劃設(shè)計(jì),甌海網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專(zhuān)注于網(wǎng)站建設(shè)10年,網(wǎng)設(shè)計(jì)領(lǐng)域的專(zhuān)業(yè)建站公司;建站業(yè)務(wù)涵蓋:甌海等地區(qū)。甌海做網(wǎng)站價(jià)格咨詢(xún):13518219792
ThinkPHP5打印sql語(yǔ)句
[?SQL?]?SHOW?COLUMNS?FROM?`think_action`?[?RunTime:0.001339s?]
[?EXPLAIN?:?array?(?'id'?=?'1',?'select_type'?=?'派數(shù)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?]
$sql = "insert into db(id,name) values('昌拿做敏余$id','耐衡$name')";
echo $sql;
?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'灶彎]);
?