Jump to content

scaleautostyle

Members
  • Posts

    58
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.scale-auto-style.com

Profile Information

  • Gender
    Male
  • Location
    canada

scaleautostyle's Achievements

Member

Member (2/5)

0

Reputation

  1. hi m4vrick... when I start this search page it was like the french side and everything was working nice. the thing I want to update was. when you select the car manufacturer a second dropdown ( car model ) will populate automaticly from the database. but to do that I don't have the choice to put a numeric value to each manufacturer. if you know an other way to do that let me know may be it will slve the problem. yours sebastien
  2. yes it's the same database. but it work on the french side... why it doen't in the english one.?? yours sebastien
  3. clic the small button at the bottom to search. thanks sebastien
  4. it should be OK because on the french side it work fine. the difference between the french side and the english one is ... I don't put the model drop down at this moment. so if you select porsche it will bring you all porsche. clic the scale24-25.com banner to be able to go on the french one. yours sebastien
  5. the things is everything work fine on the four last drop down. EX: if you choose kit manufacturer = tamiya , scale = 1/24 and the year 2004 it will bring you 2 result. if you choose only the year 2000 alone it will bring you 3 result. so these filed work correctly. so let me see something.... S
  6. exact none work. I gave you the step to make sure evryone got the same result. thanks
  7. sure... here is the form file...( the one with the dropdown list ) <html> <head> <title>(Type a title for your page here)</title> <SCRIPT language=JavaScript> function reload(form) { var val=form.cat.options[form.cat.options.selectedIndex].value; self.location='search-db-foreach.php?cat=' + val ; } </script> </head> <body > <img src="http://www.scale24-25.com/images/banners/banner.jpg" alt="banner" width="997" height="213" border="0" usemap="#Map" /> <map name="Map" id="Map"> <area shape="poly" coords="0,100,85,102,92,55,108,50,326,51,323,7,3,3" href="http://www.hobby-shop.qc.ca" alt="hobby-shop" /> <area shape="poly" coords="672,57,891,53,887,4,995,4,985,108,673,102" href="http://www.hobby-shop.qc.ca" alt="hobby-shop" /> <area shape="poly" coords="326,12,330,52,98,53,90,91,670,98,668,53,889,50,886,4" href="http://www.scale-auto-style.com" alt="" /> <area shape="rect" coords="0,132,997,212" href="index.html"> </map> <?php /* If register_global is off in your server then after reloading of the page to get the value of cat from query string we have to take special care. @$cat=$_GET['cat']; // Use this line or below line if register_global is off if(strlen($cat) > 0 and !is_numeric($cat)){ // to check if $cat is numeric data or not. echo "Data Error"; exit; } */ @$cat=$HTTP_GET_VARS['cat']; // Use this line or above line if register_global is off if (isset($_POST['todo']) && $_POST['todo'] == "search") { $todo=$_POST['todo']; $manufacturer_reel=$_POST['manufacturer_reel']; $query="select * from kit where "; @$manufacturer_reel=$_GET['manufacturer_reel']; // Use this line or below line if register_global is off if(strlen($manufacturer_reel) > 0 and !is_numeric($manufacturer_reel)){ // to check if $cat is numeric data or not. echo "Data Error"; exit; } /* ////////// Including manufacturer_reel field search //// if(strlen($manufacturer_reel) > 0 ){ $query.= " manufacturer_reel='$manufacturer_reel' and "; } //// End of class field search /////////// */ $query=substr($query,0,(strLen($query)-4)); echo $query; echo "<br><br>"; $nt=mysql_query($query); echo mysql_error(); // End if form submitted }else{ echo "<form method=post action='search-keyword.php?go'><input type=hidden name=todo value=search>"; ?> <table width="960" border="0"> <tr> <td width="355"></td> <td width="250"> </td> <td width="355"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td rowspan="9"><div align="center">To help me filling the database download the instruction and master file <a href="base de donnee/master_database.xls"><img src="catalog/images/design_web/master-bouton-en.jpg" alt="bout" width="272" height="54" border="0"></a></div></td> <td align="center"><?php ///////// Getting the data from Mysql table for first list box////////// $q=mysql_query("SELECT DISTINCT manufacturer_reel,manufacturer_reel_id FROM kit order by manufacturer_reel"); ///////////// End of query for first list box////////// ////////// Starting of first drop downlist ///////// echo "<select name='cat' onchange=\"reload(this.form)\"><option value=''>Please Choose an Option</option>"; while($row = mysql_fetch_array($q)) { if($row['manufacturer_reel_id']==@$cat){echo "<option selected value='$row[manufacturer_reel_id]'>$row[manufacturer_reel]</option>"."<BR>";} else{echo "<option value='$row[manufacturer_reel_id]'>$row[manufacturer_reel]</option>";} } echo "</select>"; echo " <br> \n"; echo " <br> \n"; // end of drop down /// ?></td> <td><div align="left">Name Of vehicule manufacturer</div></td> </tr> <tr> <td align="center"> </td> <td> </td> </tr> <tr> <td><div align="center"> <?php /////// for second drop down list we will check if manufacturer_reel is selected else we will display all the car_model///// if(isset($cat) and strlen($cat) > 0){ $q=mysql_query("SELECT DISTINCT car_model FROM kit where manufacturer_reel_id=$cat order by car_model"); }else{$q=mysql_query("SELECT DISTINCT car_model FROM kit order by car_model"); } ////////// end of query for second car_model drop down list box /////////////////////////// ////////// Starting of second drop downlist ////////// echo '<select name="car_model"><option value="car_model">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['car_model']; echo '<option>'.$thing.'</option>'; } echo "</select>"; echo " <br> \n"; echo " <br> \n"; //////// end of second drop down ////////// ?> </div> <td> vehicule manufacturer model</td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td align="center"><?php // strat of drop down /// $q=mysql_query("SELECT DISTINCT scale FROM kit ORDER BY scale"); echo '<select name="scale"><option value="scale">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['scale']; echo '<option>'.$thing.'</option>'; } echo "</select>"; echo " <br> \n"; echo " <br> \n"; ?></td> <td><div align="left">Scale of model</div></td> </tr> <tr> <td> </td> <td><div align="right"></div></td> </tr> <tr> <td align="center"><?php // start of drop down /// $q=mysql_query("SELECT DISTINCT manufacturer_kit FROM kit ORDER BY manufacturer_kit"); echo '<select name="manufacturer_kit"><option value="kit manufacturer">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['manufacturer_kit']; echo '<option>'.$thing.'</option>'; } echo "</select>"; // end of drop down /// echo " <br> \n"; echo " <br> \n"; ?></td> <td><div align="left">Name Of kit manufacturer</div></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td align="center"><?php // strat of drop down /// $q=mysql_query("SELECT DISTINCT year_prod_reel FROM kit ORDER BY year_prod_reel"); echo '<select name="year_prod_reel"><option value="vehicules year manufactured">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['year_prod_reel']; echo '<option>'.$thing.'</option>'; } echo "</select>"; // end of drop down /// echo " <br> \n"; echo " <br> \n"; ?></td> <td><div align="left"> <p>Year of production of the vehicule</p> <p> </p> </div></td> </tr> <tr> <td> </td> <td align="center"> </td> <td> </td> </tr> </table> <table width="960" border="0"> <tr> <td><div align="center"> <?php echo " <br><input type=submit value=Search name='name' action='search-keyword.php?go' > </form> "; } ?> </div></td> </tr> </table> <table width="980" border="1"> <tr> <td colspan="3" bgcolor="#EDEDED"><div align="center"><a href="http://www.modelencyclopedia.com/"><img src="catalog/images/banners/davidcuraencyclopedy.gif" alt="banner1" border="0" /></a></div></td> </tr> <tr> <td bgcolor="#EDEDED" width="480"><p align="center">Without his help this site will stay under development</p> </td> <td> </td> <td bgcolor="#EDEDED" width="480"><p align="center">Sans son aide se site serais toujours en dévelopement</p> </td> </tr> </table> </body> </html> and this is the result file... <html> <head> <title>(Type a title for your page here)</title> </head> <body > <p align="center"><img src="http://www.scale24-25.com/images/banners/banner.jpg" alt="banner" width="997" height="213" border="0" usemap="#Map" /> <map name="Map" id="Map"> <area shape="poly" coords="0,100,85,102,92,55,108,50,326,51,323,7,3,3" href="http://www.hobby-shop.qc.ca" alt="hobby-shop" /> <area shape="poly" coords="672,57,891,53,887,4,995,4,985,108,673,102" href="http://www.hobby-shop.qc.ca" alt="hobby-shop" /> <area shape="poly" coords="326,12,330,52,98,53,90,91,670,98,668,53,889,50,886,4" href="http://www.scale-auto-style.com" alt="" /> <area shape="rect" coords="-1,128,996,208" href="../index.html"> </map></p> <table width="920" border="0"> <tr> <td width="359"><p class="style5">You will find some TBC. TBC is for "To Be Confirmed". If somebody know the missing information ( TBC ) it will be appreciate to send it to me at this mail: <a href="mailto:info@hobby-shop.qc.ca">info@hobby-shop.qc.ca</a> <br /> <br /> thanks in advance for your help</p> </td> <td width="161"><div align="center"><a href="search-db-foreach.php"><img src="catalog/images/design_web/othersearch.jpg" border="0" alt="search" width="150" height="96"></a></div></td> <td width="386"> <div align="right"> <p>This logo <img src= 'http://www.scale24-25.com/images/PDF_logo.gif' width='50' height='50'/> mean that you can download a PDF file. To read it you need minimum Acrobat reader and you can download it <a href="http://get.adobe.com/reader/">here</a></p> <p>Some link will return a TBC. Sorry for any inconveniant. as soon as we will receive or do the PDF it will be updated.</p> </div></td> </tr> </table> <br> <?php if (isset($_POST['todo']) && $_POST['todo'] == "search") { $todo=$_POST['todo']; $name=$_POST['cat']; $name1=$_POST['manufacturer_kit']; $name2=$_POST['year_prod_reel']; $name3=$_POST['scale']; $name11=$_POST['car_model']; //-query the database table for the post field $sql="SELECT kit_id, kit_number, kit_name, description_eng, manufacturer_kit, manufacturer_reel, scale, engine_detail, year_prod_kit, year_prod_reel, image_id, image_id1, image_id2 FROM kit "; $sqlOperand="WHERE"; if ($name != "cat") { $sql = $sql . $sqlOperand . " manufacturer_reel LIKE '%" . $name ."%' "; $sqlOperand = " AND "; } if ($name1 != "kit manufacturer") { $sql = $sql . $sqlOperand . " manufacturer_kit LIKE '%" . $name1 ."%' "; $sqlOperand = " AND "; } if ($name2 != "vehicules year manufactured") { $sql = $sql . $sqlOperand . " year_prod_reel LIKE '%" . $name2 ."%' "; $sqlOperand = " AND "; } if ($name3 != "scale") { $sql = $sql . $sqlOperand . " scale LIKE '%" . $name3 ."%' "; $sqlOperand = " AND "; } if ($name11 != "car_model") { $sql = $sql . $sqlOperand . " car_model LIKE '%" . $name11 ."%' "; $sqlOperand = " AND "; } if ($sqlOperand == "WHERE") { echo "<p>Please enter a search query</p>"; } else { // echo '<img src="web-design/sorry.jpg" alt="sorry">'; // echo "Sorry nothing match your selection / Desolle rien ne correspond a votre selection"; // echo "run sql: <BR> $sql <BR> and display results"; } //-run the query against the mysql query function $result=mysql_query($sql); //-make the header of the table echo " <table align=center width=\"1340\" border=\"\">\n"; echo " <tr>\n"; echo" <td nowrap align=center width='95'> kit manufacturer \n"; echo" <td nowrap align=center width='55'> scale \n"; echo" <td nowrap align=center width='90'> kit number \n"; echo" <td nowrap align=center width='290'> kit name \n"; echo" <td nowrap align=center width='400'> description_eng \n"; echo" <td nowrap align=center width='125'> vehicule year \n"; echo" <td nowrap align=center width='80'> complete engine detail\n"; echo" <td nowrap align=center width='80'> Select Picture to get bigger\n"; echo" <td nowrap align=center width='75'> instruction sheet\n"; echo" <td nowrap align=center width='75'> box contain\n"; echo " <tr>\n"; //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $description_eng=$row['description_eng']; $manufacturer_kit=$row['manufacturer_kit']; $scale=$row['scale']; $car_model=$row['car_model']; $cat=$row['cat']; $manufacturer_reel=$row['manufacturer_reel']; $kit_id=$row['kit_id']; $kit_number=$row['kit_number']; $kit_name=$row['kit_name']; $engine_detail=$row['engine_detail']; $year_prod_reel=$row['year_prod_reel']; $image_id=$row['image_id']; $image_id1=$row['image_id1']; $image_id2=$row['image_id2']; //-create table of item during he while loop echo " <table align=center width=\"1340\" border=\"\">\n"; echo" <td nowrap align=center width='95'> $manufacturer_kit \n"; echo" <td nowrap align=center width='55'> $scale \n"; echo" <td nowrap align=center width='90'> $kit_number \n"; echo" <td nowrap align=center width='290'> $kit_name \n"; echo" <td nowrap width='400'> $description_eng \n"; echo" <td nowrap align=center width='125'> $year_prod_reel \n"; echo" <td nowrap align=center width='80'> $engine_detail \n"; if(!empty($image_id)) echo" <td nowrap width='80'> <a href= ".$image_id."> <img src= '".$image_id."' width='75' height='50' border='0'/>";else echo " <td nowrap width='75'> <img src='http://www.scale24-25.com/images/tbc.jpg' width='50' height='50' border='0'/>"; if(!empty($image_id1)) echo" <td nowrap width='75'> <a href= ".$image_id1."> <img src='http://www.scale24-25.com/images/PDF_logo.gif' width='50' height='50' border='0'/>";else echo " <td nowrap width='75'> <img src='http://www.scale24-25.com/images/tbc.jpg' width='50' height='50' border='0'/>"; if(!empty($image_id2)) echo" <td nowrap width='75'> <a href= ".$image_id2."> <img src='http://www.scale24-25.com/images/PDF_logo.gif' width='50' height='50' border='0'/>";else echo " <td nowrap width='75'> <img src='http://www.scale24-25.com/images/tbc.jpg' width='50' height='50' border='0'/>"; echo " </tr>\n"; echo " </table>\n"; echo " </tr>\n"; echo " </table>\n"; } } else{ echo "<p>Please enter a search query</p>"; } ?> </body> </html> I hope this will help to debug ... yours sebastien
  8. hi guy's... it's going very well one more time thans to all of you for your help. now a new one. felow these step and you will find my problem. but what is the solution?? first go on my site english section here http://scale24-25.com/search-db-foreach.php if you clic on the secon drop down and select 935 and after the search button it will retreive all the 935 model found in the database. it' what I want. BUT more specificly I want you select from the first drop down the porsche. after the 935 and then clic the search button. nothing return. WHY?? I can put the code of both file here or just the code of the 2 drop down with the search file. let me know what's going on. thanks again sebastien
  9. thnkas... with your help I found the way to do it ... here the final code... and it WORK PERFECTLY" thanks again if(!empty($image_id1)) echo" <td nowrap width='75'> <a href= ".$image_id1."> <img src='http://www.scale24-25.com/images/PDF_logo.gif' width='50' height='50' border='0'/>";else echo " <td nowrap width='75'> <img src='http://www.scale24-25.com/images/tbc.jpg' width='50' height='50' border='0'/>";
  10. thank you... this is what I have right now ( it's part of the complete code ) <?php while($row=mysql_fetch_array($result)){ $image_id=$row['image_id1']; $image_id=$row['image_id2']; echo " <table align=center width=\"1340\" border=\"\">\n"; echo" <td nowrap width='75'> <a href= ".$image_id1."> <img src= '".$image_id1."' width='50' height='50' border='0'/>"; echo" <td nowrap width='75'> <a href=".$image_id2."> <img src='".$image_id2."' width='50' height='50' border='0'/>"; } } else{ echo "<p>Please enter a search query</p>"; } ?> this will show me what I have in my database. if nothing is theyre I ave a broken image. instead of the broken image I want a picture name TBC.jpg I hope it's more clear like this. thanks in advance sebastien
  11. like I said I'm not very good in coding. so your help to solve this one is more than appreciate. this is what I want to do.... IF I have an image_id1 in the database please show it. other than that please show me the TBC.jpg picture. in php/sql how this will be write. thanks sebastien
  12. hey hey hey!! after sleeping 14 hours I found the error... sintax $#$@$@ instead of description_eng I put description.... thanks for your help. yours
  13. Hi thorpe!! maybe this will help.. below is the original query. <?php // strat of drop down /// $q=mysql_query("SELECT DISTINCT manufacturer_reel FROM kit ORDER BY manufacturer_reel"); echo '<select name="manufacturer_reel"><option value="reel manufacturer">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['manufacturer_reel']; echo '<option>'.$thing.'</option>'; } echo "</select>"; // end of drop down /// echo " <br> \n"; echo " <br> \n"; // end of drop down /// ?> it was change to be able to call and populate a second dropdown. see the new code below. ///////// Getting the data from Mysql table for first list box////////// $q=mysql_query("SELECT DISTINCT manufacturer_reel,manufacturer_reel_id FROM kit order by manufacturer_reel"); ///////////// End of query for first list box////////// ////////// Starting of first drop downlist ///////// echo "<select name='cat' onchange=\"reload(this.form)\"><option value=''>Please Choose an Option</option>"; while($row = mysql_fetch_array($q)) { if($row['manufacturer_reel_id']==@$cat){echo "<option selected value='$row[manufacturer_reel_id]'>$row[manufacturer_reel]</option>"."<BR>";} else{echo "<option value='$row[manufacturer_reel_id]'>$row[manufacturer_reel]</option>";} } echo "</select>"; ////////////////// This will end the first drop down list /////////// <?php /////// for second drop down list we will check if manufacturer_reel is selected else we will display all the car_model///// if(isset($cat) and strlen($cat) > 0){ $q=mysql_query("SELECT DISTINCT car_model FROM kit where manufacturer_reel_id=$cat order by car_model"); }else{$q=mysql_query("SELECT DISTINCT car_model FROM kit order by car_model"); } ////////// end of query for second car_model drop down list box /////////////////////////// echo '<select name="car_model"><option value="car_model">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['car_model']; echo '<option>'.$thing.'</option>'; } echo "</select>"; echo " <br> \n"; echo " <br> \n"; ?> I'm pretty sure the error came from this change. someone can look at it and let me know. these code came from the form. thanks sebastien
  14. thanks ... so this is the code of the form <?php include_once("db_connection.php"); ////////////////////////////// ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title>(Type a title for your page here)</title> <SCRIPT language=JavaScript> function reload(form) { var val=form.cat.options[form.cat.options.selectedIndex].value; self.location='search-db-foreach.php?cat=' + val ; } </script> </head> <body > <img src="http://www.scale24-25.com/images/banners/banner.jpg" alt="banner" width="997" height="213" border="0" usemap="#Map" /> <map name="Map" id="Map"> <area shape="poly" coords="0,100,85,102,92,55,108,50,326,51,323,7,3,3" href="http://www.hobby-shop.qc.ca" alt="hobby-shop" /> <area shape="poly" coords="672,57,891,53,887,4,995,4,985,108,673,102" href="http://www.hobby-shop.qc.ca" alt="hobby-shop" /> <area shape="poly" coords="326,12,330,52,98,53,90,91,670,98,668,53,889,50,886,4" href="http://www.scale-auto-style.com" alt="" /> <area shape="rect" coords="0,132,997,212" href="index.html"> </map> <?php /* If register_global is off in your server then after reloading of the page to get the value of cat from query string we have to take special care. @$cat=$_GET['cat']; // Use this line or below line if register_global is off if(strlen($cat) > 0 and !is_numeric($cat)){ // to check if $cat is numeric data or not. echo "Data Error"; exit; } */ @$cat=$HTTP_GET_VARS['cat']; // Use this line or above line if register_global is off if (isset($_POST['todo']) && $_POST['todo'] == "search") { $todo=$_POST['todo']; $manufacturer_reel=$_POST['manufacturer_reel']; $query="select * from kit where "; @$manufacturer_reel=$_GET['manufacturer_reel']; // Use this line or below line if register_global is off if(strlen($manufacturer_reel) > 0 and !is_numeric($manufacturer_reel)){ // to check if $cat is numeric data or not. echo "Data Error"; exit; } /* ////////// Including manufacturer_reel field search //// if(strlen($manufacturer_reel) > 0 ){ $query.= " manufacturer_reel='$manufacturer_reel' and "; } //// End of class field search /////////// */ $query=substr($query,0,(strLen($query)-4)); echo $query; echo "<br><br>"; $nt=mysql_query($query); echo mysql_error(); // End if form submitted }else{ echo "<form method=post action='search-keyword.php?go'><input type=hidden name=todo value=search>"; ?> <table width="960" border="0"> <tr> <td width="355"></td> <td width="250"> </td> <td width="355"> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td rowspan="9"><div align="center">To help me filling the database download the instruction and master file <a href="base de donnee/master_database.xls"><img src="catalog/images/design_web/master-bouton-en.jpg" alt="bout" width="272" height="54" border="0"></a></div></td> <td align="center"><?php ///////// Getting the data from Mysql table for first list box////////// $q=mysql_query("SELECT DISTINCT manufacturer_reel,manufacturer_reel_id FROM kit order by manufacturer_reel"); ///////////// End of query for first list box////////// ////////// Starting of first drop downlist ///////// echo "<select name='cat' onchange=\"reload(this.form)\"><option value=''>Please Choose an Option</option>"; while($row = mysql_fetch_array($q)) { if($row['manufacturer_reel_id']==@$cat){echo "<option selected value='$row[manufacturer_reel_id]'>$row[manufacturer_reel]</option>"."<BR>";} else{echo "<option value='$row[manufacturer_reel_id]'>$row[manufacturer_reel]</option>";} } echo "</select>"; ////////////////// This will end the first drop down list /////////// /* // strat of drop down /// ORIGINAL DROP DOWN $q=mysql_query("SELECT DISTINCT manufacturer_reel FROM kit ORDER BY manufacturer_reel"); echo '<select name="manufacturer_reel"><option value="reel manufacturer">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['manufacturer_reel']; echo '<option>'.$thing.'</option>'; } echo "</select>"; // end of drop down /// */ echo " <br> \n"; echo " <br> \n"; // end of drop down /// ?></td> <td><div align="left">Name Of vehicule manufacturer</div></td> </tr> <tr> <td align="center"> </td> <td> </td> </tr> <tr> <td><div align="center"> <?php /////// for second drop down list we will check if manufacturer_reel is selected else we will display all the car_model///// if(isset($cat) and strlen($cat) > 0){ $q=mysql_query("SELECT DISTINCT car_model FROM kit where manufacturer_reel_id=$cat order by car_model"); }else{$q=mysql_query("SELECT DISTINCT car_model FROM kit order by car_model"); } ////////// end of query for second car_model drop down list box /////////////////////////// ////////// Starting of second drop downlist ////////// /* echo "<select name='subcat'><option value=''>Please Choose an Option</option>"; while($row = mysql_fetch_array($q)) { echo "<option value='$row[car_model]'>$row[car_model]</option>"; } echo "</select>"; ////////////////// This will end the second drop down list /////////// ?> */ echo '<select name="car_model"><option value="car_model">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['car_model']; echo '<option>'.$thing.'</option>'; } echo "</select>"; echo " <br> \n"; echo " <br> \n"; ?> </div> <td> vehicule manufacturer model</td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td align="center"><?php // strat of drop down /// $q=mysql_query("SELECT DISTINCT scale FROM kit ORDER BY scale"); echo '<select name="scale"><option value="scale">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['scale']; echo '<option>'.$thing.'</option>'; } echo "</select>"; echo " <br> \n"; echo " <br> \n"; ?></td> <td><div align="left">Scale of model</div></td> </tr> <tr> <td> </td> <td><div align="right"></div></td> </tr> <tr> <td align="center"><?php // start of drop down /// $q=mysql_query("SELECT DISTINCT manufacturer_kit FROM kit ORDER BY manufacturer_kit"); echo '<select name="manufacturer_kit"><option value="kit manufacturer">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['manufacturer_kit']; echo '<option>'.$thing.'</option>'; } echo "</select>"; // end of drop down /// echo " <br> \n"; echo " <br> \n"; ?></td> <td><div align="left">Name Of kit manufacturer</div></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td align="center"><?php // strat of drop down /// $q=mysql_query("SELECT DISTINCT year_prod_reel FROM kit ORDER BY year_prod_reel"); echo '<select name="year_prod_reel"><option value="vehicules year manufactured">Please Choose an Option</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['year_prod_reel']; echo '<option>'.$thing.'</option>'; } echo "</select>"; // end of drop down /// echo " <br> \n"; echo " <br> \n"; ?></td> <td><div align="left"> <p>Year of production of the vehicule</p> <p> </p> </div></td> </tr> <tr> <td> </td> <td align="center"> </td> <td> </td> </tr> </table> <table width="960" border="0"> <tr> <td><div align="center"> <?php echo " <br><input type=submit value=Search name='name' action='search-keyword.php?go' > </form> "; } ?> </div></td> </tr> </table> <table width="980" border="1"> <tr> <td colspan="3" bgcolor="#EDEDED"><div align="center"><a href="http://www.modelencyclopedia.com/"><img src="catalog/images/banners/davidcuraencyclopedy.gif" alt="banner1" border="0" /></a></div></td> </tr> <tr> <td bgcolor="#EDEDED" width="480"><p align="center">Without his help this site will stay under development</p> </td> <td> </td> <td bgcolor="#EDEDED" width="480"><p align="center">Sans son aide se site serais toujours en dévelopement</p> </td> </tr> </table> </body> </html> this is the code of the file it will return the result. <?php include_once("db_connection.php"); ////////////////////////////// ?> <!doctype html public "-//w3c//dtd html 3.2//en"> <html> <head> <title>(Type a title for your page here)</title> </head> <body > <p align="center"><img src="http://www.scale24-25.com/images/banners/banner.jpg" alt="banner" width="997" height="213" border="0" usemap="#Map" /> <map name="Map" id="Map"> <area shape="poly" coords="0,100,85,102,92,55,108,50,326,51,323,7,3,3" href="http://www.hobby-shop.qc.ca" alt="hobby-shop" /> <area shape="poly" coords="672,57,891,53,887,4,995,4,985,108,673,102" href="http://www.hobby-shop.qc.ca" alt="hobby-shop" /> <area shape="poly" coords="326,12,330,52,98,53,90,91,670,98,668,53,889,50,886,4" href="http://www.scale-auto-style.com" alt="" /> <area shape="rect" coords="0,132,997,212" href="index.html"> </map></p> <table width="920" border="0"> <tr> <td width="359"><p class="style5">You will find some TBC. TBC is for "To Be Confirmed". If somebody know the missing information ( TBC ) it will be appreciate to send it to me at this mail: <a href="mailto:info@hobby-shop.qc.ca">info@hobby-shop.qc.ca</a> <br /> <br /> thanks in advance for your help</p> </td> <td width="161"> </td> <td width="386"> <div align="right"> <p>This logo <img src= 'http://www.scale24-25.com/images/PDF_logo.gif' width='50' height='50'/> mean that you can download a PDF file. To read it you need minimum Acrobat reader and you can download it <a href="http://get.adobe.com/reader/">here</a></p> <p>Some link will return a TBC. Sorry for any inconveniant. as soon as we will receive or do the PDF it will be updated.</p> </div></td> </tr> </table> <br> <?php if (isset($_POST['todo']) && $_POST['todo'] == "search") { $todo=$_POST['todo']; $name=$_POST['cat']; $name1=$_POST['manufacturer_kit']; $name2=$_POST['year_prod_reel']; $name3=$_POST['scale']; $name11=$_POST['car_model']; //-query the database table for the post field $sql="SELECT kit_id, kit_number, kit_name, description, manufacturer_kit, manufacturer_reel, scale, engine_detail, year_prod_kit, year_prod_reel, image_id, image_id1, image_id2 FROM kit "; $sqlOperand="WHERE"; if ($name != "cat") { $sql = $sql . $sqlOperand . " manufacturer_reel LIKE '%" . $name ."%' "; $sqlOperand = " AND "; } if ($name1 != "kit manufacturer") { $sql = $sql . $sqlOperand . " manufacturer_kit LIKE '%" . $name1 ."%' "; $sqlOperand = " AND "; } if ($name2 != "vehicules year manufactured") { $sql = $sql . $sqlOperand . " year_prod_reel LIKE '%" . $name2 ."%' "; $sqlOperand = " AND "; } if ($name3 != "scale") { $sql = $sql . $sqlOperand . " scale LIKE '%" . $name3 ."%' "; $sqlOperand = " AND "; } if ($name11 != "car_model") { $sql = $sql . $sqlOperand . " car_model LIKE '%" . $name11 ."%' "; $sqlOperand = " AND "; } if ($sqlOperand == "WHERE") { echo "<p>Please enter a search query</p>"; } else { // echo '<img src="web-design/sorry.jpg" alt="sorry">'; // echo "Sorry nothing match your selection / Desolle rien ne correspond a votre selection"; // echo "run sql: <BR> $sql <BR> and display results"; } //-run the query against the mysql query function $result=mysql_query($sql); //-make the header of the table echo " <table align=center width=\"1340\" border=\"\">\n"; echo " <tr>\n"; echo" <td nowrap align=center width='95'> kit manufacturer \n"; echo" <td nowrap align=center width='55'> scale \n"; echo" <td nowrap align=center width='90'> kit number \n"; echo" <td nowrap align=center width='290'> kit name \n"; echo" <td nowrap align=center width='400'> description \n"; echo" <td nowrap align=center width='125'> vehicule year \n"; echo" <td nowrap align=center width='80'> complete engine detail\n"; echo" <td nowrap align=center width='80'> Select Picture to get bigger\n"; echo" <td nowrap align=center width='75'> instruction sheet\n"; echo" <td nowrap align=center width='75'> box contain\n"; echo " <tr>\n"; //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $description =$row['description_eng']; $manufacturer_kit=$row['manufacturer_kit']; $scale=$row['scale']; $car_model=$row['car_model']; $cat=$row['cat']; $manufacturer_reel=$row['manufacturer_reel']; $kit_id=$row['kit_id']; $kit_number=$row['kit_number']; $kit_name=$row['kit_name']; $engine_detail=$row['engine_detail']; $year_prod_reel=$row['year_prod_reel']; $image_id=$row['image_id']; $image_id1=$row['image_id1']; $image_id2=$row['image_id2']; //-create table of item during he while loop echo " <table align=center width=\"1340\" border=\"\">\n"; echo" <td nowrap align=center width='95'> $manufacturer_kit \n"; echo" <td nowrap align=center width='55'> $scale \n"; echo" <td nowrap align=center width='90'> $kit_number \n"; echo" <td nowrap align=center width='290'> $kit_name \n"; echo" <td nowrap width='400'> $description_eng \n"; echo" <td nowrap align=center width='125'> $year_prod_reel \n"; echo" <td nowrap align=center width='80'> $engine_detail \n"; echo" <td nowrap width='80'> <a href=".$image_id."> <img src='".$image_id."' width='75' height='50' border='0'/>"; echo" <td nowrap width='75'> <a href= ".$image_id1."> <img src= 'http://www.scale24-25.com/images/PDF_logo.gif' width='50' height='50' border='0'/>"; echo" <td nowrap width='75'> <a href=".$image_id2."> <img src='http://www.scale24-25.com/images/PDF_logo.gif' width='50' height='50' border='0'/>"; echo " </tr>\n"; echo " </table>\n"; echo " </tr>\n"; echo " </table>\n"; } } else{ echo "<p>Please enter a search query</p>"; } ?> </body> </html> I know it's a big mess I will work on that as soon as possible. thanks in adavance sebastien
  15. thanks but like I said my knowledge are near nothing. and these files were modify by near 5 person so the result I lost the control... now I try to get it but if you can help me to get back on the track it will be VERY appreciate. I can post here the 2 files that comunicate between. if you can tell me what exactly to change.. thanks in advance sebastien
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.