Re: PHP site problems
Posted: Sun Jun 08, 2008 4:59 am
Many many thanks for your response.
Here is the code now with your suggestions included.
The error i get now is to do with the SELECT statement:
Notice: Use of undefined constant ManufacturerID - assumed 'ManufacturerID'
Under that is shows as Not Available (so i'm guessing its bypassing the form again)
As far as i can tell ManufacturerID is being pulled from the previous page. It shows up fine in the link in the url and subsequently the GET at the top doesn't throw up any errors. I tried putting $ManufacturerID = ("ManufacturerID"); in under the connection statements too, but that has no impact.
Towards the end of the select statement, i changed the ManufacturerID to just have ' either side and also with ` but that simply removed the error and went straight to the unavailable print again
Thanks for your previous assistance. Might i impose on your continued expert help, or that of any other board members.
Mikey
Here is the code now with your suggestions included.
Code: Select all
<?php
ini_set ("display_errors", "1");
error_reporting(E_ALL);
//$CategoryID=$_GET["CategoryID"];
//$CategoryName=$_GET["CategoryName"];
$GroupID=$_GET["GroupID"];
$Group=$_GET["Group"];
$ManufacturerID=$_GET["ManufacturerID"];
$ManufacturerName=$_GET["ManufacturerName"];
//$ManufacturerCategoryID=$_GET["ManufacturerCategoryID"];
echo "Microsoft.Jet.OLEDB.4.0";
$conn=mysql_connect("localhost","XXXX","XXXX");
mysql_select_db("XXXX",$conn);
$ManufacturerID = ("ManufacturerID");
$ManufacturerCategoryID = ("ManufacturerCategoryID");
$ManufacturerName = ("ManufacturerName");
$CategoryID = ("CategoryID");
$CategoryName = ("CategoryName");
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" cool gridx="8" gridy="8" showgridx showgridy usegridx usegridy><tr height="8"><td align="center"><img src="images/CGLLogoSmall.jpg"></td></tr></table>
<hr />
<br />
<table width="100%">
<tr><td align="center" class="heading"><a href="Gallery.php" class="heading">Gallery</a> - <a href="Group.php?Group=<? print $Group;?>&GroupID=<? print $GroupID;?>" class="heading"><? print $Group;?> Prints</a> - <? print $ManufacturerName;?></td></tr>
<tr><td> </td></tr>
<tr><td colspan="4" align="center"><strong>Please select a Category</strong></td></tr>
<tr><td colspan="4" align="center">
<table width="90%"><tr><td valign="top"></td><td><table class="heading" width="500px"><td align="left">
<?php
$rs=mysql_query("SELECT Category.CategoryID AS CategoryID, Category.CategoryName, Manufacturer.ManufacturerID AS ManufacturerID, Manufacturer.ManufacturerName, ManufacturerCategory.ManufacturerCategoryID, ManufacturerCategory.ManufacturerID, ManufacturerCategory.CategoryID FROM Category, Manufacturer, ManufacturerCategory WHERE Category.CategoryID = ManufacturerCategory.CategoryID AND Manufacturer.ManufacturerID = ManufacturerCategory.ManufacturerID AND Manufacturer.ManufacturerID = '" & ManufacturerID & "' Order by Category.CategoryName");
if ($rs)
{ //This will check if the query failed or not
if (mysql_num_rows($rs) > 0)
{ //This will check if there were any results returned from the query
while ($row = mysql_fetch_array($rs))
{
print "<form name=\"Paintingsform\" method=\"post\" action=\"Paintings.php\">";
print "<input type=\"hidden\" name=\"CategoryID\" value=". $row['CategoryID'] ." />";
print "<tr><td align=\"left\">";
print "<a href=\"Paintings.php?CategoryID=". $row['CategoryID'] ."&CategoryName=". $row['CategoryName'] ."&Group=". $row['Group'] ."&GroupID=". $row['GroupID'] ."&ManufacturerID=". $row['ManufacturerID'] ."&ManufacturerName=". $row['ManufacturerName'] ."&ManufacturerCategoryID=". $row['ManufacturerCategoryID'] ."\" class=\"heading\">";
print "</td><td align=\"left\">";
print "<a href=\"Paintings.php?CategoryID=". $row['CategoryID'] ."&CategoryName=". $row['CategoryName'] ."&Group=". $row['Group'] ."&GroupID=". $row['GroupID'] ."&ManufacturerID=". $row['ManufacturerID'] ."&ManufacturerName=". $row['ManufacturerName'] ."&ManufacturerCategoryID=". $row['ManufacturerCategoryID'] ." \" class=\"heading\">". $row['CategoryName'] ."</a>";
print " - <span class=\"subheading\"></span></td><td></tr></form>";
}
}
else
{
print "no results found"; //Edit this line as needed for what you need displayed when no database records are found in the query
}
}
else
{
print "Not Available";
}
mysql_close($conn);
?>
Notice: Use of undefined constant ManufacturerID - assumed 'ManufacturerID'
Under that is shows as Not Available (so i'm guessing its bypassing the form again)
As far as i can tell ManufacturerID is being pulled from the previous page. It shows up fine in the link in the url and subsequently the GET at the top doesn't throw up any errors. I tried putting $ManufacturerID = ("ManufacturerID"); in under the connection statements too, but that has no impact.
Towards the end of the select statement, i changed the ManufacturerID to just have ' either side and also with ` but that simply removed the error and went straight to the unavailable print again
Thanks for your previous assistance. Might i impose on your continued expert help, or that of any other board members.
Mikey