Jump to content

[SOLVED] Please Help Me!!!!


smd8061

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.