0

Good evening! Can you help me with this problems? This request

 "SELECT * FROM `articles` WHERE save=1" 

return this error

"Undeclared variable: 0",

why? what`s wrong? Here is a database table This is code: [php]

$sql = "SELECT * FROM `".$matherial_base."` WHERE save=1";
$result = mysql_query($sql);
if (!$result) {
    echo "Error with request ($sql): " . mysql_error();
    exit;}
//Counting
@$col = mysql_num_rows($result);
if(mysql_num_rows($result) == 0){
    echo 'Here is nothing, add some!';
}
Andrei Morozov
  • 19
  • 1
  • 10
  • 3
    the code in your question is not related to your error .. so .. add the rest of the code – ScaisEdge Oct 23 '16 at 17:51
  • Show us the code where you actually trying to show the result. The problem is there. – S.I. Oct 23 '16 at 17:51
  • [php] $sql = "SELECT * FROM `".$matherial_base."` WHERE save=1"; $result = mysql_query($sql); if (!$result) { echo Error with request ($sql): " . mysql_error(); exit;} //Counting @$col = mysql_num_rows($result); if(mysql_num_rows($result) == 0){ echo 'Here is nothing, add some!'; } – Andrei Morozov Oct 23 '16 at 19:54

0 Answers0