我期待计数由下面使用的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