smd8061 Posted January 11, 2008 Author Share Posted January 11, 2008 I took off the WHERE bit. Told you I was unsure if you wanted that. lol Not to sound ungrateful or anything but I tried that and now it is not even using the forms or searching, it is just showing the database. 2 2 2 3 2007-11-12 1000 $9000 2008-01-22 1 1 1 1 2007-11-12 100 $1000 2008-01-01 1 1 1 2007-11-12 100 $400 2 2 2 2007-11-12 300 $2001 IT Looks Like this only with the none used forms on top. Quote Link to comment https://forums.phpfreaks.com/topic/85529-solved-please-help-me/page/2/#findComment-436506 Share on other sites More sharing options...
twostars Posted January 11, 2008 Share Posted January 11, 2008 I took off the WHERE bit. Told you I was unsure if you wanted that. lol Not to sound ungrateful or anything but I tried that and now it is not even using the forms or searching, it is just showing the database. 2 2 2 3 2007-11-12 1000 $9000 2008-01-22 1 1 1 1 2007-11-12 100 $1000 2008-01-01 1 1 1 2007-11-12 100 $400 2 2 2 2007-11-12 300 $2001 IT Looks Like this only with the none used forms on top. In that case, please explain in detail what the script is supposed to do. IE: What the query should return, in what format, and how. Quote Link to comment https://forums.phpfreaks.com/topic/85529-solved-please-help-me/page/2/#findComment-436508 Share on other sites More sharing options...
affordit Posted January 11, 2008 Share Posted January 11, 2008 This is what I use to fetch products by category <? include("k_falls_dbinfo2.inc.php"); mysql_connect(mysql,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM products WHERE category='$category'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b><center>Products By Category</center></b><br><br>"; ?> <table align="center" width="100%" border="0" cellspacing="2" cellpadding="2"> <tr> <th align="center"><font face="Arial, Helvetica, sans-serif">UPC</font></th> <th align="center"><font face="Arial, Helvetica, sans-serif">Category</font></th> <th align="center"><font face="Arial, Helvetica, sans-serif">Manufacturer</font></th> <th align="center"><font face="Arial, Helvetica, sans-serif">Description</font></th> <th align="center"><font face="Arial, Helvetica, sans-serif">Model Number</font></th> <th align="center"><font face="Arial, Helvetica, sans-serif">Price</font></th> <th align="center"><font face="Arial, Helvetica, sans-serif">Vendor</font></th> <th align="center"><font face="Arial, Helvetica, sans-serif">Phone</font></th> <th align="center"><font face="Arial, Helvetica, sans-serif">More Info</font></th> <th align="center"><font face="Arial, Helvetica, sans-serif">Website</font></th> <th align="center"><font face="Arial, Helvetica, sans-serif">E-Mail</font></th> </tr> <? $i=0; while ($i < $num) { $upc=mysql_result($result,$i,"upc"); $category=mysql_result($result,$i,"category"); $manufacturer=mysql_result($result,$i,"manufacturer"); $description=mysql_result($result,$i,"description"); $model=mysql_result($result,$i,"model"); $price=mysql_result($result,$i,"price"); $vendor=mysql_result($result,$i,"vendor"); $phone=mysql_result($result,$i,"phone"); $extra=mysql_result($result,$i,"extra"); $website=mysql_result($result,$i,"website"); $email=mysql_result($result,$i,"email"); ?> <tr> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$upc"; ?></font></td> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$category"; ?></font></td> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$manufacturer"; ?></font></td> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$description"; ?></font></td> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$model"; ?></font></td> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$price"; ?></font></td> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$vendor"; ?></font></td> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$phone"; ?></font></td> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$extra"; ?></font></td> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$website"; ?></font></td> <td align="center"><font size="-3"><font face="Arial, Helvetica, sans-serif"><? echo "$email"; ?></font></td> </tr> <? ++$i; } echo "</table>"; I hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/85529-solved-please-help-me/page/2/#findComment-436632 Share on other sites More sharing options...
smd8061 Posted January 11, 2008 Author Share Posted January 11, 2008 In that case, please explain in detail what the script is supposed to do. IE: What the query should return, in what format, and how OK, i guess i wasn't clear on what i was trying to get it to do. I have a drop down box and i want to be able to select a columns name and then in the text box input a number, and when you hit search it will search that number in one of the columns IE: the one you selected in the drop down box. Then script searches the database in the column that is selected for the number that you inputed, and it then posts in a table the information that corresponds with that number. Quote Link to comment https://forums.phpfreaks.com/topic/85529-solved-please-help-me/page/2/#findComment-436784 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.