This question already has an answer here:
When I use "55555555555555555" it returns the values, when I use "A5555555555555555" I get Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\bidTobuy2.php on line 35 []
<?php
$VIN = "A5555555555555555";
$result = mysql_query("SELECT VIN, Bid, BoughtFrom, Mileage from tblevaluated WHERE VIN = $VIN");
$json_response = array();
////line 35:
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$row_array['BoughtFrom'] = $row['BoughtFrom'];
$row_array['Bid'] = $row['Bid'];
$row_array['miles'] = $row['Mileage'];
array_push($json_response,$row_array);
}
echo json_encode($json_response);
?>
</div>
strings vs numbers, man. need to quote them.
$result = mysql_query("SELECT VIN, Bid, BoughtFrom, Mileage from tblevaluated WHERE VIN = '$VIN'");
The quotes at the end need to be moved in
$result = mysql_query("SELECT VIN, Bid, BoughtFrom, Mileage from tblevaluated WHERE VIN = $VIN");
Should be
$sql = "SELECT VIN, Bid, BoughtFrom, Mileage from tblevaluated WHERE VIN = '" . $VIN . "'";
$result = mysql_query($sql);
Edit: Yeah, as they said, strings definitely need to be wrapped. Updated.