I changed my codes from this
$query = "SELECT first_id, first, webpage_id FROM first WHERE first= ?";
$stmt = $connect->prepare($query);
$stmt->bind_param('s', $first);
$stmt->execute();
$result = $stmt->get_result();
while($row = $result->fetch_array()){
$first_id = $row['first_id'];
$first = $row['first'];
$webpage_id = $row['webpage_id'];
echo '<div class="yellow container">
<div class="alt">
<div class="first_name left"><h1>'.$row['first'].'</h1></div>
<div>
<div class="add_sub"><input type="button" class="addsub" data-id="'.$row['first_id'].'" /></div>
</div>
</div>';
$query = "SELECT webpage_id, url, explanation FROM webpage WHERE webpage_id= ?";
$stmt = $connect->prepare($query);
$stmt->bind_param('i', $webpage_id);
$stmt->execute();
$result_ce = $stmt->get_result();
Into this in order to use stored procedures in my website. My first codes work perfect but second one stop working after execute stored procedure correctly. It says Call to a member function bind_param() on boolean on line 42
$result = $connect->query("CALL selectfirst('$first')");
// all codes above stays same
while($row = $result->fetch_array()){
$first_id = $row['first_id'];
$first = $row['first'];
$webpage_id = $row['webpage_id'];
echo '<div class="yellow container">
<div class="alt">
<div class="first_name left"><h1>'.$row['first'].'</h1></div>
<div>
<div class="add_sub"><input type="button" class="addsub" data-id="'.$row['first_id'].'" /></div>
</div>
</div>';
$query2 = "SELECT webpage_id, url, explanation FROM webpage WHERE webpage_id= ?";
$stmt = $connect->prepare($query2);
$stmt->bind_param('i', $webpage_id); //line 42
$stmt->execute();
$result_ce = $stmt->get_result();
my stored procedure written by phpmyadmin gui
. I just wrote SELECT * FROM first = ufirst;
and clicked create. Maybe problem is there?
IMPORTANT!! I used trigger_error($connect->error."[$query2]")
after second sql and page says *Commands out of sync; you can't run this command now[SELECT webpage_id, url, explanation FROM webpage WHERE webpage_id=53]*
What that means?