|
A set of php scripts-performance ! |
|
|||||||||||||||||||
|
Content of file selezAuto.php ( update & show ) $id_conness = mysql_connect() or die("Impossible to connect to Database"); mysql_select_db("test",$id_conness); @mysql_query("delete from auto where (now() > time_stamp)"); $query= "SELECT * FROM auto WHERE (builder = '$builder') AND (model LIKE '%$model%') AND (fuel_type = '$fuel_type') AND (year > $year) AND (time_stamp > now()) AND (price < $max_price) ORDER BY price"; $id_result = mysql_query ($query,$id_conness); if(!$id_result) {echo "Impossible to read, error n° ",mysql_errno(),". ",mysql_error(),".";} $_rows= mysql_num_rows($id_result); // Read of rows'database results echo "<h3>Results: there are $_rows autos for sale in this selection</h3>"; // Displays results in a an html - table while($tabauto = mysql_fetch_array($id_result,MYSQL_ASSOC)) { echo "<table width=\"400\" border=\"5\">"; echo"<tr><td><h2>{$tabauto[builder]} {$tabauto[model]} {$tabauto[year]}: {$tabauto[price]} euro</h2> {$tabauto[ad_text]}</td></tr>"; echo"<br/>"; } mysql_close($id_conness); ?>
|