<?php
$username = "dcatkin";
$password = "hellfire";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
$selected = mysql_select_db("cars",$dbh)
or die("Could not select cars");
$args->arg_type[0] = $result;
$args->arg_type[1] = "$Make, $Year, $Model, $Price, $Description, $Name, $Address, $Email, $Phone, $URL";
$result = mysql_query("SELECT id Make, Year, Model, Price, Description, Name, Address, Email, Phone, URL FROM Cars");
$result = array('Year, Price, Description, Name, Address, Email, Phone, URL');
$query="SHOW COLUMNS FROM Cars;";
$query="SELECT * FROM Cars;";
$mysql_fetch_array = ($result);
$car_search = mysql_query($query,$handler) or die(mysql_error());
$car_search_col=10; // number of columns in table
while (list ($Make, $Year, $Model, $Price, $Description, $Name, $Address, $Email, $Phone, $URL)= mysql_fetch_array($car_search))
{
$car_search[$car_search]=$Cars;
$car_search_Car++;
}
$result = mysql_query($query,$handler) or die(mysql_error());
for ($j=0; $j<=mysql_num_rows($result); $j++)
{
$matrice=mysql_fetch_array($result);
for ($i=0; $i<=$numero_make; $i++) $$make[$i]=$matrice[$make[$i]];
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf ("ID: %s Make: %s", $row["id"], $row["Make"]);
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf ("ID: %s Model: %s", $row["id"], $row["Model"]);
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf ("ID: %s Price: %s", $row["id"], $row["Price"]);
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf ("ID: %s Description: %s", $row["id"], $row["Description"]);
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf ("ID: %s Name: %s", $row["id"], $row["Name"]);
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf ("ID: %s Address: %s", $row["id"], $row["Address"]);
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf ("ID: %s Email: %s", $row["id"], $row["Email"]);
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf ("ID: %s Phone: %s", $row["id"], $row["Phone"]);
}
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
printf ("ID: %s URL: %s", $row["id"], $row["URL"]);
}
mysql_free_result($result);
}
include("template.php");
mysql_close($dbh);
?>
Thank you, the last post really helped.
http://hp-car.com/cars/search/search.php