0

I need your help for get result from this code:

<?php
    $hx10c = "%{$metur}";
    echo 'Service id- '.$svid;
    $query = $dbfrli->prepare("SELECT `uid`, `name`, `lastname` FROM `business` WHERE `type` like ? AND `uid` >= ?");
    $query->bind_param("ss", $hx10c, $svid);
    $query->execute();
    $query->store_result();
    //$query->bind_result($hx11c, $hx12c, $hx13c);// bind result variables
    $numrows = $query->num_rows;
    //echo 'Row count- '.$numrows;
    echo "<br>";
    $count = 1 ;
    while($row_data = $result->fetch_assoc()){
        if($count<=3){
            $uid[] = $row_data['uid'];
            $name[] = $row_data['name'];
            $lastname[] = $row_data['lastname'];
        }
        $count++;
    }
    if($numrows == 1){
        $ids = '1035';
        $names = 'Aniket';
        $lastnames = 'Astrologers';
    }
    elseif($numrows == 2){
        $ids = $uid[1];
        $names = $name[1];
        $lastnames = $lastname[1];
    }
    elseif($numrows == 3){
        $ids = $uid[2];
        $names = $name[2];
        $lastnames = $lastname[2];
    }
?>

I need result on "Number of rows condition" in above code.

Dharman
  • 30,962
  • 25
  • 85
  • 135
hitakb
  • 11
  • 5
  • Help us help you - can you share some sample data and the result you're trying to get? It would help make the question clearer. – Mureinik Jul 17 '18 at 19:48
  • @Mureinik Sir, Getting _[Fatal error: Uncaught Error: Call to undefined method mysqli_stmt::fetch_assoc() in C:\xampp\htdocs_ – hitakb Jul 17 '18 at 20:34

0 Answers0