Search script not returning results. What's wrong with my code?

It’s not throwing any errors, but this is my PHP for my search feature. I press search on the form, and it moves to this file but shows no results. I’ve been at the computer all day and am a bit worn out, so it may be obvious.

[code]<?php
if (isset($_POST[‘field’])) {
include “mysql.class.php”;
$mysqldb = new mysql(“SECRET”,“SECRET”,“SECRET”,“SECRET”);
$mysqldb->connect();
$mysqldb->select();

	$vin = $_POST['vin'];
	$mileage = $_POST['mileage'];
	$field = $_POST['field'];
	
	if ($field == "kbb") {
		$mysqldb->query("SELECT vin, mileage, make, nodel, year, kbb FROM vehicles WHERE vin='$vin' AND mileage='$mileage'");
	} elseif ($field == "blackbook") {
		$mysqldb->query("SELECT vin, mileage, make, nodel, year, blackbook FROM vehicles WHERE vin='$vin' AND mileage='$mileage'");
	} elseif ($field == "nada") {
		$mysqldb->query("SELECT vin, mileage, make, nodel, year, nada FROM vehicles WHERE vin='$vin' AND mileage='$mileage'");
	}
	
	if ($mysqldb->numrows() > 0) {
		while ($row = $mysqldb->fetchobject())
			echo "$row->vin, $row->mileage, $row->make, $row->model, $row->year, $row->$field<br />"
		} else {
			echo "No results found.";
		}
	}

?>[/code]

It could be:
[php]while ($row = $mysqldb->fetchobject())
echo “$row->vin, $row->mileage, $row->make, $row->model, $row->year, $row->$field
” //no semicolon (:wink:
} else {[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service