soniamcangel Posted May 5, 2009 Share Posted May 5, 2009 Hey guys! I'm having an issue with my school project. What I m trying to to is to create a simple dj store website. I extract all i need from mysql without any issues. but, when I want to get my photo out it doesn t work here is my table <html> <head> <title>Dj Shop</title> </head> <body> <p align="center"><img src="logo.png" width="208" height="91"></p> <p align="center"><img src="bar.png" width="947" height="75"></p> <hr> <p> </p> <div align="center"></div> <p> <?php $myid = $_GET["brands"]; print $myid; //connection mysql_connect("mysql","username","pass") or die ('I cannot connect to the database:' . mysql_error()); mysql_select_db("djstore"); $query = mysql_query("SELECT * FROM store WHERE idbrands = ". $myid); // Show results while($row = mysql_fetch_array($query)) { echo "<br /> Brands: ".$row ['brandsname']. "<br /> Platform: ".$row['platform']. "<br /> price: ".$row['price']. "<br /> image: ".$row['image']." <br />";} // here is where i call the picture, but i m sure it s wrong! how to it through varchar ?> </p> <p> </p> <p> </p> <p> </p> <p align="center"><img src="bas.png" width="983" height="289"></p> <p> </p> </body> </html> please help me, thanks! Sonia Quote Link to comment Share on other sites More sharing options...
Ken2k7 Posted May 5, 2009 Share Posted May 5, 2009 1. SQL injection. Please read up mysql_real_escape_string unless you want people to be tampering with your DB data, possibly delete all your tables. 2. Calling it is fine, but most of the table entries has no image to display. =/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.