
scaleautostyle
Members-
Posts
58 -
Joined
-
Last visited
Never
Everything posted by scaleautostyle
-
thank you VERY MUCH now it's working. so next thing I will try to put 6 more drop down in this form. I hope it will work. thanks again sebastien
-
HA!!! I just see it thanks now I redo and it start something. it echo my table header but doesn't run the sql query to display something. these code was working number one when I do it with a texte search field. now why it doesn't work in this one.???? see the code in the previous post... search-kewyword.php thaks sebastien
-
ok but at the end of my form where my submit button is I say the action where to go <?php // End if form submitted }else{echo "<form method=post action=''><input type=hidden name=todo value=search>";$q=mysql_query("SELECT DISTINCT manufacturer_reel FROM kit ORDER BY manufacturer_reel");echo '<select name="manufacturer_reel"><option>Reel manufacturer</option>';while($row = mysql_fetch_array($q)) {$thing = $row['manufacturer_reel'];echo '<option>'.$thing.'</option>';}echo "</select>"; echo "<br><input type=submit value=Search name='name' action='search-keyword.php?go' ></form>";} ?> where other else I have to put the info?? yours sebastien
-
thanks kenrbnsn your new code work... the dropdown is theyre. but now when I select a manufacturer anyone... here I took honda I got this result select * from kit where manufacturer_reel='honda' ??? where did they came from in the search-keyword.php file ?? it's realy not that I want. I see some error in my original work and change it so find below my 2 update file 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> </head> <body > <?php if (isset($_POST['todo']) && $_POST['todo'] == "search") { $todo=$_POST['todo']; $manufacturer_reel=$_POST['manufacturer_reel']; $query="select * from kit where "; ////////// 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=''><input type=hidden name=todo value=search>"; $q=mysql_query("SELECT DISTINCT manufacturer_reel FROM kit ORDER BY manufacturer_reel"); echo '<select name="manufacturer_reel"><option>Reel manufacturer</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['manufacturer_reel']; echo '<option>'.$thing.'</option>'; } echo "</select>"; echo " <br><input type=submit value=Search name='name' action='search-keyword.php?go' > </form> "; } ?> and the SEARCH-keyword.php where it supposed to return the info. <?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 > <?php if (isset($_POST['todo']) && $_POST['todo'] == "search") { $todo=$_POST['todo']; $name=$_POST['name']; //-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 WHERE manufacturer_reel LIKE '%" . $name ."%'"; //-run the query against the mysql query function $result=mysql_query($sql); //-make the header of the table echo " <table align=center width=\"1255\" 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='95'> vehicule manufacturer \n"; echo" <td nowrap align=center width='75'> year of reel production of car \n"; echo" <td nowrap align=center width='75'> complete engine detail\n"; echo" <td nowrap align=center width='75'> Select Picture to get bigger\n"; echo" <td nowrap align=center width='75'> instruction sheet\n"; echo" <td nowrap align=center width='50'> box contain\n"; echo " <tr>\n"; //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $description =$row['description']; $manufacturer_kit=$row['manufacturer_kit']; $scale=$row['scale']; $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=\"1255\" border=\"\">\n"; echo" <td nowrap align=center width='95'> $manufacturer_kit \n"; echo" <td nowrap align=center width='95'> $scale \n"; echo" <td nowrap align=center width='95'> $manufacturer_reel \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 \n"; echo" <td nowrap align=center width='75'> $year_prod_reel \n"; echo" <td nowrap align=center width='75'> $engine_detail \n"; echo" <td nowrap width='75'> <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='50'> <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>"; } } } ?> yours sebastien
-
sorry I don't why my code doesn't want to show in the last post there is it.. <?php // End if form submitted }else{ echo "<form method=post action=''><input type=hidden name=todo value=search>"; $q=mysql_query("SELECT DISTINCT manufacturer_reel FROM kit ORDER BY manufacturer_reel"); echo '<select name=manufacturer_reel="manufacturer_reel"><option>Reel manufacturer</option>'; while($row = mysql_fetch_array($q)) { ?>
-
How to disable href in certain cases?
scaleautostyle replied to kingnothing's topic in PHP Coding Help
I habe a question. do you have a file to download for all video or some have a mp3 and other doesn't have?? yours sebastien -
thanks kenrbnsn but are you refering to the live in this code??? <?php // End if form submitted}else{echo "<form method=post action=''><input type=hidden name=todo value=search>";$q=mysql_query("SELECT DISTINCT manufacturer_reel FROM kit ORDER BY manufacturer_reel");echo '<select name=manufacturer_reel="manufacturer_reel"><option>Reel manufacturer</option>';while($row = mysql_fetch_array($q)) {$thing = $row['manufacturer_reel'];echo '<option>'.$thing.'</option>';?> in the case of an afirnative answer you code doen't show my dropdown instead of mine where it show the dropdown. I get the message when I hit the submit button so I think the error is on my searh=keyword file no ?? I know the message says Notice: Undefined index: manufacturer_reel in ......search-db.php on line 18 select * from student whe but ..... yours sebastien
-
Hi everyone... I try to adapt the previous coding to met my needs. but looklike it's not easy than was I think. I receive this message when I it the submit button.... Notice: Undefined index: manufacturer_reel in ......search-db.php on line 18 select * from student whe this is my code <?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 > <?php if (isset($_POST['todo']) && $_POST['todo'] == "search") { $todo=$_POST['todo']; $manufacturer_reel=$_POST['manufacturer_reel']; $query="select * from kit where "; ////////// 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=''><input type=hidden name=todo value=search>"; $q=mysql_query("SELECT DISTINCT manufacturer_reel FROM kit ORDER BY manufacturer_reel"); echo '<select name=manufacturer_reel="manufacturer_reel"><option>Reel manufacturer</option>'; while($row = mysql_fetch_array($q)) { $thing = $row['manufacturer_reel']; echo '<option>'.$thing.'</option>'; } echo "</select>"; echo " <br><input type=submit value=Search name='name' action='search.php?go'> </form> "; } ?> </body> </html> and this is my search-keyword.php file that supposed to return the appropriate data. thanks in advance sebastien <?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 > <?php if (isset($_POST['todo']) && $_POST['todo'] == "search") { $todo=$_POST['todo']; $manufacturer_reel=$_POST['manufacturer_reel']; //-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 WHERE manufacturer_reel LIKE '%" . $manufacturer_reel ."%'"; //-run the query against the mysql query function $result=mysql_query($sql); //-make the header of the table echo " <table align=center width=\"1255\" 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='95'> vehicule manufacturer \n"; echo" <td nowrap align=center width='75'> year of reel production of car \n"; echo" <td nowrap align=center width='75'> complete engine detail\n"; echo" <td nowrap align=center width='75'> Select Picture to get bigger\n"; echo" <td nowrap align=center width='75'> instruction sheet\n"; echo" <td nowrap align=center width='50'> box contain\n"; echo " <tr>\n"; //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $description =$row['description']; $manufacturer_kit=$row['manufacturer_kit']; $scale=$row['scale']; $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=\"1255\" border=\"\">\n"; echo" <td nowrap align=center width='95'> $manufacturer_kit \n"; echo" <td nowrap align=center width='95'> $scale \n"; echo" <td nowrap align=center width='95'> $manufacturer_reel \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 \n"; echo" <td nowrap align=center width='75'> $year_prod_reel \n"; echo" <td nowrap align=center width='75'> $engine_detail \n"; echo" <td nowrap width='75'> <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='50'> <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>"; } } } ?>
-
thank you thorpe that's work... now I will try do cusotmize this file to met my needs. thanks to everyone sebastien
-
Hi tomtimms!! MAGIE.. don;t know why but now working... except for one thing I receive this message Notice: Undefined index: todo in .............search-db.php on line 16 this is the code at the line 16 $todo=$_POST['todo']; so what's the problem yours sebastien
-
it's already done but same result sebastien
-
Hi!! see below a form. when I run it it doesn't work like it suppose. find attache a screenshot of the load page. here's the code <? 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 > <? $todo=$_POST['todo']; if(isset($todo) and $todo=="search"){ $less=$_POST['less']; $greater=$_POST['greater']; $class=$_POST['class']; $sex=$_POST['sex']; $search_text=$_POST['search_text']; $type=$_POST['type']; $query="select * from student where "; ////////// Including mark less than field search //// if(strlen($less) > 0 ){ $query.= " mark < $less and "; } //// End of class field search /////////// ////////// Including mark less than field search //// if(strlen($greater) > 0 ){ $query.= " mark > $greater and "; } //// End of class field search /////////// ////////// Including class field search //// if(strlen($class) > 0 ){ $query.= " class='$class' and "; } //// End of class field search /////////// ////////// Checking of sex in the query //// if(strlen($sex) > 0 ){ $query.= " sex='$sex' and "; } //// End of sex field search /////////// ////////////////////////// Key word search query ///////// $search_text=ltrim($search_text); $search_text=rtrim($search_text); if(strlen($search_text)>0){ if($type<>"any"){ $query .=" name='$search_text'"; }else{ $kt=split(" ",$search_text);//Breaking the string to array of words // Now let us generate the sql while(list($key,$val)=each($kt)){ if($val<>" " and strlen($val) > 0){$query .= " name like '%$val%' or ";} }// end of while $query=substr($query,0,(strLen($query)-3)); // this will remove the last or from the string. } // end of if else based on type value $query.=" and "; }// end of if area , if search_text value is entered ///////////////End of adding key word search query ////////// $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=''><input type=hidden name=todo value=search>"; $q=mysql_query("select distinct class from student"); echo "<select name=class><option value=''>Any Class</option>"; while($n=mysql_fetch_array($q)){ echo "<option value=$n[class]>$n[class]</option>"; } echo "</select>"; echo "<input type=radio name=sex value=male>Male <input type=radio name=sex value=female>Female <input type=radio name=sex value='' checked> Any<br>"; echo "<br>Name Match<br><input type=text name=search_text ><br> <input type=radio name=type value=any checked>Match any where <input type=radio name=type value=exact>Exact Match <br><br> Mark of the student <br> Less than<input type=text name=less size=2>Greater than <input type=text name=greater size=2> <br><input type=submit value=Search> </form> "; } ?> </body> </html> any help will be appreciate. I'm sure it's a stupid thing but for now I don't see it. yours sebastien [attachment deleted by admin]
-
why it doesn't search number alone???
scaleautostyle replied to scaleautostyle's topic in PHP Coding Help
thank you VERY much now working good. one more question. Why I can't put to word in my field search. EX: tamiya 935 tamiya is a manufacturert_kit and 935 is on the kit_name thanks in adavance sebastien -
hi everybody.. small issue here and I'm stuck with it.. here is my search form http://scale24-25.com/search_form.php if you put 935 in the field it will return the argument that he found nothing. but if you put porsche 935 it will return you the 3 porsche 935 listed in the database. WHY when I put 935 it doesn't return this result??? this is the code for the search.php ( for those who see my other post yes I put the COMPLETE field for every picture. I hope to find something else to replace that) <?php include_once("db_connection.php"); if(isset($_POST['submit'])){ if(isset($_GET['go'])){ if(preg_match("/^[ a-zA-Z]+/", $_POST['name'])){ $name=$_POST['name']; //-query the database table $sql="SELECT kit_id, kit_number, kit_name, description, manufacturer_kit, manufacturer_reel, engine_detail, year_prod_kit, year_prod_reel, scale, image_id, image_id1, image_id2, image_id3, image_id4, image_id5, image_id6, image_id7, image_id8, image_id9, image_id10, image_box1, image_box2, image_box3 FROM kit WHERE kit_number LIKE '%" . $name ."%' OR kit_name LIKE '%" . $name . "%' OR description LIKE '%" . $name . "%' OR manufacturer_kit LIKE '%" . $name . "%' OR year_prod_reel LIKE '%" . $name ."%'"; //-run the query against the mysql query function $result=mysql_query($sql); //-make the header of the table echo " <table align=center width=\"1895\" 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='70'> year of reel production of car \n"; echo" <td nowrap align=center width='70'> complete engine detail\n"; echo" <td nowrap align=center width='85'> Select Picture to get bigger\n"; echo" <td nowrap align=center width='85'> box contain pic #1\n"; echo" <td nowrap align=center width='85'> box contain pic #2\n"; echo" <td nowrap align=center width='85'> box contain pic #3\n"; echo" <td nowrap align=center width='81'> instruction sheet page 1\n"; echo" <td nowrap align=center width='82'> instruction sheet page 2\n"; echo" <td nowrap align=center width='81'> instruction sheet page 3\n"; echo" <td nowrap align=center width='81'> instruction sheet page 4\n"; echo" <td nowrap align=center width='81'> instruction sheet page 5\n"; echo" <td nowrap align=center width='81'> instruction sheet page 6\n"; echo" <td nowrap align=center width='81'> instruction sheet page 7\n"; echo" <td nowrap align=center width='81'> instruction sheet page 8\n"; echo" <td nowrap align=center width='81'> instruction sheet page 9\n"; echo" <td nowrap align=center width='81'> instruction sheet page 10\n"; echo " <tr>\n"; //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $description =$row['description']; $manufacturer_kit=$row['manufacturer_kit']; $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']; $scale=$row['scale']; $image_box1=$row['image_box1']; $image_box2=$row['image_box2']; $image_box3=$row['image_box3']; $image_id=$row['image_id']; $image_id1=$row['image_id1']; $image_id2=$row['image_id2']; $image_id3=$row['image_id3']; $image_id4=$row['image_id4']; $image_id5=$row['image_id5']; $image_id6=$row['image_id6']; $image_id7=$row['image_id7']; $image_id8=$row['image_id8']; $image_id9=$row['image_id9']; $image_id10=$row['image_id10']; //-create table of item during he while loop echo " <table align=center width=\"1895\" 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 \n"; echo" <td nowrap align=center width='70'> $year_prod_reel \n"; echo" <td nowrap align=center width='70'> $engine_detail \n"; echo" <td nowrap width='75'> <a href=".$image_box1."> <img src='".$image_box1."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_box2."> <img src='".$image_box2."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_box3."> <img src='".$image_box3."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id."> <img src='".$image_id."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id1."> <img src='".$image_id1."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id2."> <img src='".$image_id2."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id3."> <img src='".$image_id3."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id4."> <img src='".$image_id4."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id5."> <img src='".$image_id5."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id6."> <img src='".$image_id6."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id7."> <img src='".$image_id7."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id8."> <img src='".$image_id8."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id9."> <img src='".$image_id9."' width='75' height='50'/>"; echo" <td nowrap width='75'> <a href=".$image_id10."> <img src='".$image_id10."' width='75' height='50'/>"; echo " </tr>\n"; echo " </table>\n"; echo " </tr>\n"; echo " </table>\n"; } } else{ echo "<p>Please enter a search query</p>"; } } } ?> the database info for this one is like this: field: kit_name type: varchar(30) hope this help yours sebastien
-
small issue when I upload my form
scaleautostyle replied to scaleautostyle's topic in PHP Coding Help
Solve... thanks... NEWBY error I forgot to update my database yours sebastien only one problem to solve for today... how to shoe multiple image... see the appropriate thread for this one. thanks sebastien -
small issue when I upload my form
scaleautostyle replied to scaleautostyle's topic in PHP Coding Help
thanks.. this is the complete code.. hope this help <?php include_once("db_connection.php"); if(isset($_POST['submit'])){ if(isset($_GET['go'])){ if(preg_match("/^[ a-zA-Z]+/", $_POST['name'])){ $name=$_POST['name']; //-query the database table $sql="SELECT kit_id, kit_number, kit_name, description, manufacturer_kit, manufacturer_reel, engine_detail, year_prod_kit, year_prod_reel, scale, image_id FROM kit WHERE kit_name LIKE '%" . $name ."%' OR description LIKE '%" . $name . "%' OR manufacturer_kit LIKE '%" . $name ."%'"; //-run the query against the mysql query function $result=mysql_query($sql); //-make the header of the table echo " <table align=center width=\"100%\" 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='70'> year of reel production of car \n"; echo" <td nowrap align=center width='70'> complete engine detail\n"; echo" <td nowrap align=center width='75'> Select Picture to get bigger\n"; echo " <tr>\n"; //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $description =$row['description']; $manufacturer_kit=$row['manufacturer_kit']; $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']; $scale=$row['scale']; $image_id=$row['image_id']; //-create table of item during he while loop echo " <table align=center width=\"100%\" 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 \n"; echo" <td nowrap align=center width='70'> $year_prod_reel \n"; echo" <td nowrap align=center width='70'> $engine_detail \n"; echo" <td nowrap width='75'> <a href=".$image_id."> <img src='".$image_id."' width='75' height='50'/>"; echo " </tr>\n"; echo " </table>\n"; echo " </tr>\n"; echo " </table>\n"; } } else{ echo "<p>Please enter a search query</p>"; } } } ?> yours sebastien -
Hi!!. I just upload my form into my production server and .. SURPRISe got an error message. everything work OK on my local server... WHY is it showing this. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /...../search.php on line 31 this is what start my line 31 and so on... 32, 33 etc.. while($row=mysql_fetch_array($result)){ $description =$row['description']; $manufacturer_kit=$row['manufacturer_kit']; $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']; $scale=$row['scale']; $image_id=$row['image_id']; any advice will be welcome yours sebastien
-
how can I do a loop to display my picture???
scaleautostyle replied to scaleautostyle's topic in PHP Coding Help
that's right because if I have to do a fix table I will get +- 23 column 7 of data and the other for picture. but only a few record +- 50% get the other 16 space the rest will took 6 - column. so it will not be a nice looking. thanks in advance for any input to solve the problem yours sebastien -
can you shw your code... it will be easier to help you yours sebastien
-
how can I do a loop to display my picture???
scaleautostyle replied to scaleautostyle's topic in PHP Coding Help
what you mean?? in my head is make sence... here is again with other word. each item have multiple image. but doesn't how many for wach item how can I display them... is it more sence like that?? yours sebastien -
NOw it's going to the good way. except for one thing. the code like I do it display only 1 picture. in fact in some case I have 2 picture on other 5, 3 8 etc.. I never know how many picture it will be display. I don't want to create 15 column and attribute a variable fo each image to get a result taht in a case I have 2 picture shown on the table and get 13 empty. I don't know if someone understand what I want to do. if yes some light is welcome. this is the working code <?php include_once("db_connection.php"); if(isset($_POST['submit'])){ if(isset($_GET['go'])){ if(preg_match("/^[ a-zA-Z]+/", $_POST['name'])){ $name=$_POST['name']; //-query the database table $sql="SELECT kit_id, kit_number, kit_name, description, manufacturer_kit, manufacturer_reel, engine_detail, year_prod_kit, year_prod_reel, scale, image_id FROM kit WHERE kit_name LIKE '%" . $name ."%' OR description LIKE '%" . $name . "%' OR manufacturer_kit LIKE '%" . $name ."%'"; //-run the query against the mysql query function $result=mysql_query($sql); //-make the header of the table echo " <table align=center width=\"100%\" 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 width='400'> description \n"; echo" <td nowrap align=center width='70'> year of reel production of car \n"; echo" <td nowrap align=center width='70'> complete engine detail\n"; echo" <td nowrap align=center width='75'> Select Picture to get bigger\n"; echo " <tr>\n"; //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $description =$row['description']; $manufacturer_kit=$row['manufacturer_kit']; $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']; $scale=$row['scale']; $image_id=$row['image_id']; //-create table of item during he while loop echo " <table align=center width=\"100%\" 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 \n"; echo" <td nowrap align=center width='70'> $year_prod_reel \n"; echo" <td nowrap align=center width='70'> $engine_detail \n"; echo" <td nowrap width='75'> <a href=".$image_id."> <img src='".$image_id."' width='75' height='50'/>"; echo " </tr>\n"; echo " </table>\n"; echo " </tr>\n"; echo " </table>\n"; } } else{ echo "<p>Please enter a search query</p>"; } } } ?>
-
an easy one for you... how to...
scaleautostyle replied to scaleautostyle's topic in PHP Coding Help
was to tired. so now it work like I want.. so this is the code I got. o if someone else got the same problem you will got a working code to start sorry for the one who told me it's the worst uncleaned code he seen... but the quote code you got is not mine. check VS this one. anyway. thanks to everybody to guide me in the good direction. will post an other question for an other problem. yours sebastien <?php include_once("db_connection.php"); if(isset($_POST['submit'])){ if(isset($_GET['go'])){ if(preg_match("/^[ a-zA-Z]+/", $_POST['name'])){ $name=$_POST['name']; //-query the database table $sql="SELECT kit_id, kit_number, kit_name, description, manufacturer_kit, manufacturer_reel, engine_detail, year_prod_kit, year_prod_reel, scale, image_id FROM kit WHERE kit_name LIKE '%" . $name ."%' OR description LIKE '%" . $name . "%' OR manufacturer_kit LIKE '%" . $name ."%'"; //-run the query against the mysql query function $result=mysql_query($sql); //-make the header of the table echo " <table align=center width=\"990\" border=\"\">\n"; echo " <tr>\n"; echo" <td nowrap align=center width='83'> kit manufacturer \n"; echo" <td nowrap align=center width='25'> scale \n"; echo" <td nowrap align=center width='60'> kit number \n"; echo" <td nowrap align=center width='290'> kit name \n"; echo" <td nowrap width='400'> description \n"; echo" <td nowrap align=center width='70'> year of reel production of car \n"; echo" <td nowrap align=center width='70'> complete engine detail\n"; echo" <td nowrap align=center width='75'> Picture\n"; echo " <tr>\n"; //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $description =$row['description']; $manufacturer_kit=$row['manufacturer_kit']; $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']; $scale=$row['scale']; $image_id=$row['image_id']; //-create table of item during he while loop echo " <table align=center width=\"990\" border=\"\">\n"; echo" <td nowrap align=center width='83'> $manufacturer_kit \n"; echo" <td nowrap align=center width='25'> $scale \n"; echo" <td nowrap align=center width='60'> $kit_number \n"; echo" <td nowrap align=center width='290'> $kit_name \n"; echo" <td nowrap width='400'> $description \n"; echo" <td nowrap align=center width='70'> $year_prod_reel \n"; echo" <td nowrap align=center width='70'> $engine_detail \n"; echo" <td nowrap width='75'> <img src='".$image_id."' width='75' height='50'/>"; echo " </tr>\n"; echo " </table>\n"; echo " </tr>\n"; echo " </table>\n"; } } else{ echo "<p>Please enter a search query</p>"; } } } ?> -
I made a table in my while to display the result of the query. everything work NUMBER 1. but now I want to put a header at the top of this table to identify each column. I try to make an other table just before the while with the same size of TD width than my table do in the while but... doesn't work.. hum in fact it work... it gave me a table but the width is not the same as the one I got in the while loop. this is my final code without the header. if someone can help me finding a way to solve this problem it will be VERY appreciate yours sebastien this is the code <?php include_once("db_connection.php"); if(isset($_POST['submit'])){ if(isset($_GET['go'])){ if(preg_match("/^[ a-zA-Z]+/", $_POST['name'])){ $name=$_POST['name']; //-query the database table $sql="SELECT kit_id, kit_number, kit_name, description, manufacturer_kit, manufacturer_reel, engine_detail, year_prod_kit, year_prod_reel, scale, image_id FROM kit WHERE kit_name LIKE '%" . $name ."%' OR description LIKE '%" . $name . "%' OR manufacturer_kit LIKE '%" . $name ."%'"; //-run the query against the mysql query function $result=mysql_query($sql); //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $description =$row['description']; $manufacturer_kit=$row['manufacturer_kit']; $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']; $scale=$row['scale']; $image_id=$row['image_id']; echo " <table align=center width=\"990\" border=\"\">\n"; echo " <tr>\n"; echo" <td align=center width='83'> $manufacturer_kit \n"; echo" <td align=center width='25'> $scale \n"; echo" <td align=center width='60'> $kit_number \n"; echo" <td align=center width='290'> $kit_name \n"; echo" <td width='400'> $description \n"; echo" <td align=center width='50'> $year_prod_reel \n"; echo" <td align=center width='35'> $engine_detail \n"; echo" <td width='75'> <img src='".$image_id."' width='75' height='50'/>"; echo " </tr>\n"; echo " </table>\n"; } } else{ echo "<p>Please enter a search query</p>"; } } } ?>
-
Why the picture doesn't appear???
scaleautostyle replied to scaleautostyle's topic in PHP Coding Help
problem solve. sebastien -
Why the picture doesn't appear???
scaleautostyle replied to scaleautostyle's topic in PHP Coding Help
it's done this is my code corrected. <?php include_once("db_connection.php"); if(isset($_POST['submit'])){ if(isset($_GET['go'])){ if(preg_match("/^[ a-zA-Z]+/", $_POST['name'])){ $name=$_POST['name']; //-query the database table $sql="SELECT kit_id, kit_number, kit_name, description, manufacturer_kit, manufacturer_reel, engine_detail, year_prod_kit, year_prod_reel, scale, image_id FROM kit WHERE kit_name LIKE '%" . $name ."%' OR description LIKE '%" . $name . "%' OR manufacturer_kit LIKE '%" . $name ."%'"; //-run the query against the mysql query function $result=mysql_query($sql); //-create while loop and loop through result set while($row=mysql_fetch_array($result)){ $description =$row['description']; $manufacturer_kit=$row['manufacturer_kit']; $kit_id=$row['kit_id']; $kit_number=$row['kit_number']; $kit_name=$row['kit_name']; $engine_detail=$row['engine_detail']; $year_prod_kit=$row['year_prod_kit']; $scale=$row['scale']; $image_id=$row['image_id']; //-display the result of the array echo "<ul>\n"; echo "<li>" .$kit_number . " " . $manufacturer_kit . " " . $kit_name . " " . $description . " " . $year_prod_kit . " " . $engine_detail . " " . $scale . " </li>\n"; echo "<img src='".$image_id['image_id']."' width='150' height='100'/>"; echo "</ul>"; } } else{ echo "<p>Please enter a search query</p>"; } } } ?> and I stille get the same thing.... thanks sebastien