Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.2k views
Welcome To Ask or Share your Answers For Others

1 Answer

You can use the below code for getting the value num_rows in an object with PHP. I implemented the code used in the above code for getting value in the object.

<?php              
     include("../functions/functions.php");
     include("./db.php");
     global $conn;

$ip = get_ip();
$select = "SELECT * FROM `cart` WHERE `ip_address`= '$ip' ";
$run_check_prod = mysqli_query($conn,$select);
if(mysqli_num_rows($run_check_prod) > 0) {
  //the $run_check_prod is object and num_rows is key
   echo $run_check_prod->num_rows;
} 
?>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...