Hello,
I am using a calc element with the following php code (including a SQL statement), and the result should be zero (0), and it always return 1:
$mysql = new mysqli('localhost', 'database', 'databasepassword', 'etc') or die('your\'re dead');
$db = JFactory::getDbo();
$query = "SELECT COUNT(Userid) FROM fichasaude WHERE (Alunoaescolher='Teste2' and userid={$my->id})";
$result = $mysql->query($query) or die($mysql->error);
$num = $result->num_rows;
echo $num;
What?s worng with it?
Thank you in advance for your help.
I am using a calc element with the following php code (including a SQL statement), and the result should be zero (0), and it always return 1:
$mysql = new mysqli('localhost', 'database', 'databasepassword', 'etc') or die('your\'re dead');
$db = JFactory::getDbo();
$query = "SELECT COUNT(Userid) FROM fichasaude WHERE (Alunoaescolher='Teste2' and userid={$my->id})";
$result = $mysql->query($query) or die($mysql->error);
$num = $result->num_rows;
echo $num;
What?s worng with it?
Thank you in advance for your help.