Hey I was wondering if my ip_address is 0 and I want to check all tables that have a 0 ip_address and then execute a function of that. So something like this code:
mysql_connect(db_server, db_user, db_pass);
$ipzerouseroffline = mysql_db_query(db_name,"SELECT ip_address = '0' FROM user");
if ( $ipzerouseroffline == 0 ) {
//THEN CODE GOES HERE
}
Is that the correct way to write? If the ip_address is zero then the code passes.
I think this is what you want:
$con = mysqli_connect(db_server, db_user, db_pass, db_name);
$result = mysqli_query($con,"SELECT * FROM user WHERE ip_address = '0'");
while($row = mysqli_fetch_array($result)){
//CODE
}
mysqli_close($con);