Hope someone can help with this, although I might be a bit vague. (But will be happy to post any code that might help.)
Basically I do a few sites for a company, and everything is coming together nicely moving everything to a new reseller hosting account where everything can site. I’m basically doing some redesign and new database work for them.
But there’s one site I’m basically just trying to move over, that already has a database. I’ve copied the site onto the new hosting, copied the database across and created a new connection file.
I must admit the code is all a bit more PHPO heavy than what I’m used to working with. so have run into a problem trying to figure out what data is not displaying due to queries failing. As far as I can tell the connection is working, and the queries have not changed.
Anyway - the main page is here, where you should be able to click on the furniture images to go to the product page :
http://www.miradatravelmedia.com/lusty/public_html/index.php
But when you click through the product page query is failing :
http://www.miradatravelmedia.com/lusty/public_html/products.php?category=1
The products page is mostly PHP and looks like this :
<?php
if (!@empty($_REQUEST["img"])) {
require_once("../includes/hft_image.php");
$img = new hft_image($_REQUEST["img"]);
$img->resize(200,180,"-");
$img->output_resized("");
exit;
}
$page = "products";
include("../includes/header.php");
include("../includes/db_open.php");
$sql = "SELECT `id`, `name` FROM `categories` WHERE `id` = '" . $_REQUEST["category"] . "'";
$result = mysql_query($sql) or die("Query failed : $sql at line " . __line__);
$category = mysql_fetch_assoc($result);
?>
<div id="trail"><a href="shop.php">Shop</a> > Lloyd Loom <?php echo $category["name"]?></div>
<div class="clear" id="divider1"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
<h1>Lloyd Loom <?php echo $category["name"]?></h1>
<?php
$sql =
"SELECT * " .
"FROM `products` " .
"WHERE `category` = '" . $_REQUEST["category"] . "' " .
"ORDER BY `order`";
$result = mysql_query($sql) or die("Query failed : $sql at line " . __line__);
if (mysql_num_rows($result) == 0) {
?>
<p>Coming soon ...</p>
<?php
} else {
$n = 0;
while ($row = mysql_fetch_assoc($result)) {
$n++;
?>
<a href="product.php?id=<?php echo $row["id"]?>" class="product"<?php if ($n == mysql_num_rows($result)) echo " id=\\"last\\""?>>
<?php
if ($file = glob("images/products/" . $row["id"] . "_*.*")) {
?>
<img src="img.php?img=<?php echo $file[0]?>&width=200&height=180" alt="<?php echo $row["code"]?>" />
<?php
} else {
?>
<div id="no_image">No image found</div>
<?php
}
?>
<?php echo $row["code"]?>
</a>
<?php
if (is_int($n / 4)) {
?>
<div class="clear"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
<?php
}
}
}
?>
<div class="clear" id="divider2"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
<?php
include("../includes/footer.php");
?>
If anyone could shed any light on what’s going wrong still, that would be much appreciated.
Thanks.