JADASDesigner Posted October 30, 2008 Share Posted October 30, 2008 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 More sharing options...
DeanWhitehouse Posted October 30, 2008 Share Posted October 30, 2008 It is not defined, none of your variables are. Shouldnt it be something like $row['producttitle']; Link to comment https://forums.phpfreaks.com/topic/130757-solved-where-is-the-error/#findComment-678588 Share on other sites More sharing options...
Mchl Posted October 30, 2008 Share Posted October 30, 2008 Since he uses extract($row) then no. Check if column names in products table match the variable names you use. [edit] Don't use extract() I should add... Link to comment https://forums.phpfreaks.com/topic/130757-solved-where-is-the-error/#findComment-678594 Share on other sites More sharing options...
JADASDesigner Posted October 30, 2008 Author Share Posted October 30, 2008 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> Link to comment https://forums.phpfreaks.com/topic/130757-solved-where-is-the-error/#findComment-678596 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.