With help from this board ages ago i built this script.
it worksfine see it here http://www.earthquip.com.au/product.php?subid=114
but what i need to now is to have it also grab and display a new record excatualy the same as above. I tried duplicating the script and renaming the variables but it was getting very confusing.
currently it grabs a querystring eg ?subid=114 but what i want it to do now is grab multiple querystrings so something like this.
?subid=114&113
so http://www.earthquip.com.au/product.php?subid=113
it would display this underneath 114.
so 114 and 113 would be on the same page. if your looking at the page it will display first 114 information then 113 information
something like this
List of Products for Equipment Loaders Wheeled
bla bla
bla bla
bla bla
List of Products for Equipment Loaders Crawler
bla bla
bla bla
bla bla
ill tell you now their is a page that has 6 queries that i need to bring onto 1 page.eg
?subid=1
?subid=2
?subid=3
etc..
here is the code sorry for the dump. its very long.
thanks in advance aron
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?
$conn = mysql_connect("localhost", "earthquip67", "transdb793") or
die ("Could Not connect to Database");
$db = mysql_select_db("transdat_com_au", $conn) or
die ("Could Not select db");
?>
<?
$query = "SELECT DISTINCT machines. FROM machines WHERE machines.subcat_id = 114 AND machines.supp_id = '1008' ";
$query2 = "SELECT DISTINCT machines., makes2. FROM machines, makes2 WHERE machines.subcat_id = $114 AND machines.make_id = makes2.id AND machines.supp_id = '1008' ";
$query3 = "SELECT machines.subcat_id, machines.supp_id, subcat2. FROM machines, subcat2 WHERE machines.subcat_id = subcat2.id AND machines.subcat_id = $114 AND machines.supp_id = '1008'";
$result = mysql_query($query) or die("Query failed");
$result2 = mysql_query($query2) or die("Query failed");
$result3 = mysql_query($query3) or die("Query failed");
$line3 = mysql_fetch_array($result3, MYSQL_ASSOC);
?>
<p class="head"><br>
List of Products for Equipment <? print $line3["name"]; ?></p>
<?
/ Printing results in HTML /
print "<table width=100% border=0 cellpadding=3 cellspacing=3>\n";
print "<tr>\n";
print "<td width=10% align=left valign=top>ID </td>\n";
print "<td width=15 align=left valign=top> </td>\n";
print "<td width=10% align=left valign=top>Make</td>\n";
print "<td width=10% align=left valign=top>Model</td>\n";
print "<td width=10% align=left valign=top>Year</td>\n";
print "<td width=20% align=left valign=top>Serial #</td>\n";
print "<td width=10% align=left valign=top>Capacity</td>\n";
print "<td width=15% align=left valign=top>Price</td>\n";
print "<td width=10% align=left valign=top>Stock #</td>\n";
print " </tr>\n";
while (($line2 = mysql_fetch_array($result2, MYSQL_ASSOC)) && ($line = mysql_fetch_array($result, MYSQL_ASSOC)))
##while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
{
print "\t<tr>\n";
print "\t\t<td width=10% align=left valign=top><a href=\"productdescription.php?id=" . $line["id"] . "\">" . $line["id"] . "</a></td>\n";
print "\t\t<td width=5% align=left valign=top><a href=\"productdescription.php?id=" . $line["id"] . "\"><img src=../photo.gif width=15 height=15 border=0 ></a></td>\n";
print "\t\t<td width=10% align=left valign=top>" . $line2["name"] . "</td>\n";
print "\t\t<td width=10% align=left valign=top>" . $line["model"] . "</td>\n";
print "\t\t<td width=10% align=left valign=top>" . $line["year"] . "</td>\n";
print "\t\t<td width=20% align=left valign=top><a href=\"proddescription.php?id=" . $line["id"] . "\">" . $line["serial"] . "</a></td>\n";
print "\t\t<td width=10% align=left valign=top>" . $line["capacity"] . "</td>\n";
print "\t\t<td width=15% align=left valign=top>" . $line["price"] . "</td>\n";
print "\t\t<td width=10% align=left valign=top>" . $line["stock_number"] . "</td>\n";
print "\t</tr>\n";
}
print "</table>\n";
/ Free resultset /
mysql_free_result($result);
mysql_free_result($result2);
/ Closing connection /
mysql_close($link);
?>