iT邦幫忙

0

剛接觸PHP,不清楚下面3行的用意

<?php
$SqlStr="select * from tp01 where isdel<>'1'  order by cast(sortno as decimal)";
$res_bcate= $db->get_results($SqlStr);
$rec_cnt_bcate=count($res_bcate);
?>
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

2 個回答

3
暐翰
iT邦大師 1 級 ‧ 2018-03-27 17:02:26
最佳解答

第一行用一個變數保存要執行的SQL命令

第二行,跟資料庫下SQL命令,並反回結果資料
類似在sql server studio下命令

第三行,變數紀錄DB返回結果的行數(舉例:5行資料 count值 = 5)

我要發表回答

立即登入回答