-1

I went through some posts but I didn't find the answer that I was looking for. I don't use so much PHP and MYSQL in my work, but i have to create some demo for the page.

So i want to do this: With PHP i want to check in SQL database if column 'no' has value = 0, if it has then echo this, if has different value then echo this.

$query=mysqli_query($conn,"SELECT * FROM tablename WHERE no = 0");
$row=mysqli_fetch_array($query);

if($row="0")
{
    echo "not confirmed";
}
    else
{
    echo "confirmed";
}
u_mulder
  • 54,101
  • 5
  • 48
  • 64
unforgiven
  • 145
  • 1
  • 2
  • 12

1 Answers1

0

For comparing you need to use this:

if ($row['no']=="0") {
    echo "not confirmed";
} else {
    echo "confirmed";
}
kRicha
  • 797
  • 9
  • 27