Hi all, the following PHP MysSQLi query works in XAMPP but not in WAMP:
<?php
include('../../inc/config.php');
$mysqli = mysqli_connect($config['host'], $config['user'], $config['pass'], $config['db']);
$responseQuery = "SELECT tr.id as trid,tr.topicid,tr.usersid,DATE_FORMAT(tr.date_added,'%b %d, %Y %H:%i')
AS format_date_added,tr.date_added,tr.response,tr.status,
t.id, t.usersid as creatorid,
u.id, u.authuser, u.memtype, u.fn,u.ln,u.avatar
FROM topic_response tr
LEFT OUTER JOIN topic t ON t.id=tr.topicid
LEFT OUTER JOIN users u ON u.id=tr.usersid
WHERE tr.topicid='".$_GET['id']."'
ORDER BY tr.date_added";
$responseData = $mysqli->query($responseQuery);
$responseCount = mysqli_num_rows($responseData);
In xampp the script works a treat. In WAMP I get this very common error:
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in ... on line 14
That error is talking about this line:
$responseCount = mysqli_num_rows($responseData);
I have the MySQLi extension, I've checked that in my php.ini file and it's enabled. Any ideas people? I've just made the switch from XAMPP to WAMP as XAMPP was having a few issues randomly and corrupting my databases. WAMP works great... apart from this issue.
Michael