I'm trying to find the best way to see if mysqli has results or not. I want the code to execute if it has a valid query and to do nothing if not.
Here is the code I tried that does not work:
$result = mysqli_query($con,"SELECT * FROM promoCode where code = '$code'")
or die("Error in mySql statement!");
if (mysqli_num_rows($result)==1) { echo "yahoo it worked! "; }