<?php
require_once "includes/db_connection.php";
$sqlCommand = "SELECT * FROM table1 WHERE questionId = $id";
$query = mysqli_query($db_connection, $sqlCommand) or die (mysqli_error());
$num_rows = mysqli_num_rows($query);
echo "Tabela sadrzi " . $num_rows . " redova.";
mysqli_free_result($query);
mysqli_close($db_connection);
?>
With this type of code where I have WHERE questionId = $id
statement it give me an error Undefinded index Id, and mysqli_error() expects exactly 1 parameter. I see that a lot of time, and somehow i fix a problem, but now i really don't now. I am new, still learning, but i really dont have idea. If i delete this WHERE questionId = $id
it is working, its show me how many rows is it in there, but i need this with Where statement where it can show me, how many records is it for the specific ID.