Basically i wanna put all this code in a seperate file
Code: <?php
$query = "select product.ProductID, product.ProductName, product.ProductCategory, product.ProductPrice, product.ProductQuantity, product.ProductDescription, image.ImageID, image.ImagePath, image.ImageName, product_image.ImageID, product_image.ProductID
FROM product
JOIN product_image
ON product.ProductID = product_image.ProductID
JOIN image
ON image.ImageID = product_image.ImageID";
//Use this query below
$result = mysql_query($query, $conn)
or die ("Unable to perform query");
while($row= mysql_fetch_array($result))
{
$productname = $row['ProductName'];
$productprice = $row['ProductPrice'];
$imagename = $row["ImageName"];
$imagepath = $row["ImagePath"];
//Get the product id so i can pass it
$productid =$row["ProductID"];
$file = $imagepath.$imagename;
?>
<ol>
<li class="newproducts">
<!-- Make the product name clickable and pass through its id -->
<?php echo '<a href="product_details.php?productid='.$productid.'">' .$productname.'</a><br />';?>
<?php echo '<a href="'.$file.'" target="_blank" rel="lightbox"><img src="'.$file.'" width="100" height="100"/><br />';?>
<?php echo 'Price' . $row ['ProductPrice'].'<br /><br />';?>
</li>
</ol>
<?php
}?>
Then call it on the index page, how can i do this
Function module "DPS_CHECK_TABLE_EXISTS" not found (after OSS 1422843 impl)
Dear All,
Where is my php.ini???
HiFirst off - apologies - i'm not a coder so this may sound very amateur.I'm having an issue with files being uploaded via a submission form. Files under 2mb are fine. Files over 2mb are not. I've
SQL query not working well
Hi,
SQL Query/echo not working
Hey all,I'm trying to run (what I thought) was a simple operation and it isn't working. I haven't coded anything in about 2 years, and I'm self taught at that so I know I've got quite a few gaps in
php + mysql count consecutive data
I have a database of values and I want to work out how to display them if the values match a consecutive pattern.For example, I might have the table "eggs" with the values "1",
mail with attachment problems
Hi. I have the following code:Code: else if(file_exists("site".$timp.".zip")) {$file=fopen("site".$timp.".zip", "rb"); $data=fread($file,
article site help remaining text
Hi all hope you will be fineI am creating a article site in this site i want to put some text on main page and link it via "read more" text from articles page and complete article will be
PHP error. Need help urgently
Hi,I am programming a php site and have a problem that i just cant find out how to fix. When i run it i get this error "Parse error: syntax error, unexpected $end in
Not reloading page after php form submit
Hello helpful souls out there. You guys have come through for me in the recent past and I'm hoping someone out there can either help me or point me in the right direction.I have the following site,
Files in current folder. Should be an easy fix.
Never mind. I've asked about this before and just found my answer. Anyway to delete this?