Answer the question
In order to leave comments, you need to log in
Why is it giving an error when using WHERE in a query?
This query works
$sql = "SELECT `name`, `header`, `text` FROM `nature`";
if(result(->num_rows>0)
while($res = $result->fetch_assoc())
echo $res['name'];
$sql = "SELECT `name`, `header`, `text` FROM `nature` WHERE `id`=`1`";
if(result(->num_rows>0)
while($res = $result->fetch_assoc())
echo $res['name'];
Answer the question
In order to leave comments, you need to log in
`1` // столбец с названием 1
'1' // строка, содержащая один символ - единицу
1 // целое число, единица
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question