< /blockquote>
Например, при использовании get_result () работает нормально. < /p>
Код: Выделить всё
$sql = "SELECT id, auction_title, auction_date, auction_time, auction_address, auction_city, auction_state, auction_zipcode, description FROM auctions WHERE join_id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i",$row['join_id']);
$stmt->execute();
$result = $stmt->get_result();
< /code>
Хотя это не удается.$sql2 = "SELECT id, auction_title, auction_date, auction_time, auction_address, auction_city, auction_state, auction_zipcode, description FROM auctions WHERE join_id = ?";
$stmt = $conn->prepare($sql2);
$stmt->bind_param("i",$joinid);
$stmt->execute();
$stmt->bind_result($id, $auction_title, $auction_date, $auction_time, $auction_address, $auction_city, $auction_state, $auction_zipcode, $description);
< /code>
Вот var_dump с боковым сравнением, различные запросы, но одинаковые результаты в целом: < /p>
$sql = "SELECT join_id, bus_name, first_name, last_name, address, city, state, zip, phone, fax, email, wsaddr, image_name, bio FROM auctioneer WHERE id = ?";
$stmt = $conn->prepare($sql);
$stmt->bind_param("i",$getVar);
$stmt->execute();
//$results = $stmt->get_result();
$stmt->bind_result($join_id, $bus_name, $first_name, $last_name, $address, $city, $state, $zip, $phone, $fax, $email, $wsaddr, $image_name, $bio);
var_dump($stmt);
//$stmt->close();
< /code>
Использование get_result:
object(mysqli_stmt)#2 (10) { ["affected_rows"]=> int(1) ["insert_id"]=> int(0) ["num_rows"]=> int(0) ["param_count"]=> int(1) ["field_count"]=> int(14) ["errno"]=> int(0) ["error"]=> string(0) "" ["error_list"]=> array(0) { } ["sqlstate"]=> string(5) "00000" ["id"]=> int(1) }< /code> < /p>
с использованием bind_result:
object(mysqli_stmt)#2 (10) { ["affected_rows"]=> int(-1) ["insert_id"]=> int(0) ["num_rows"]=> int(0) ["param_count"]=> int(1) ["field_count"]=> int(14) ["errno"]=> int(0) ["error"]=> string(0) "" ["error_list"]=> array(0) { } ["sqlstate"]=> string(5) "00000" ["id"]=> int(1) }Подробнее здесь: https://stackoverflow.com/questions/340 ... ing-the-re