Jump to content

Recommended Posts

It brings up the picture, but not the title...  Where might the error be? It is probably staring me in the face, but I am going on 72 hours of no sleep, now.

<div class="productbox">
<?php
$product=SW45;
//connect to MySQL
$connect = mysql_connect("localhost", "jadasdes", "notreallymypassword")
or die("Hey loser, check your server connection.");
//make sure we’re using the right database
mysql_select_db("jadasdes_ppproducts");
$query = "SELECT * FROM products WHERE productid LIKE '$product'";
$results = mysql_query($query)
or die(mysql_error());
while ($row = mysql_fetch_array($results)) {
extract($row);
echo "<img src=\"http://www.example.com/pp/images/".$productid."-largeimage.jpg\" align = \"left\">";
echo " <br> ";
echo "<a href = \"http://www.example.com/pp/Disguised_Pepper_Spray/index.php?=".$productid.">".$producttitle."</a>";
echo "<p>";
}
?>

</div>

Link to comment
https://forums.phpfreaks.com/topic/130757-solved-where-is-the-error/
Share on other sites

I was missing a \" on line 17. html error.  yay.  TGFRB  (THANK GOD FOR RED BULL)

<div class="productbox">
<?php
$product=SW45;
//connect to MySQL
$connect = mysql_connect("localhost", "jadasdes", "meaka003")
or die("Hey loser, check your server connection.");
//make sure we’re using the right database
mysql_select_db("jadasdes_ppproducts");
$query = "SELECT * FROM products WHERE productid LIKE '$product'";
$results = mysql_query($query)
or die(mysql_error());
while ($row = mysql_fetch_array($results)) {
extract($row);
echo  $producttitle;
echo "<img src=\"http://www.jadasdesign.com/pp/images/".$productid."-largeimage.jpg\" align = \"left\">";
echo " <br> ";
echo "<a href = \"http://www.jadasdesign.com/pp/Disguised_Pepper_Spray/index.php?=".$productid."\">".$producttitle."</a>";
echo "<p>";
}
?>

</div>

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.