我期待計數由下面使用的mysqli /預處理語句查詢返回的記錄數:
$mysql = new mysqli(DB_SERVER, DB_USER, DB_PASSWORD, DB_NAME) or die('There was a problem connecting to the database');
$stmt = $mysql->prepare('SELECT id,vcref,jobtitle,jobtype,jobintro,closingdate FROM jobs WHERE active = 1');
$stmt->execute();
$stmt->store_result;
$stmt->bind_result($id,$vcref,$jobtitle,$jobtype,$jobintro,$closingdate);
$stmt->fetch();
$totalLiveJobs = $stmt->num_rows();
輸出是consistantly 0
多少,如果你直接在數據庫執行它應該返回? – Ismael 2009-10-20 14:00:10
我知道有2行相匹配的查詢條件 - 這是一個思想家 – 2009-10-20 14:14:04