ryanmetzler3 Posted August 31, 2013 Share Posted August 31, 2013 I have a mysql table named store. In that table there are the following rows: name, date, location, and imagelocation. Right now I have this code: @$term = $_POST['term']; $sql = mysql_query("select * from store where name = '$term'"); $numberofrows=mysql_num_rows($sql); while ($row = mysql_fetch_array($sql)) { $imgurl = $row['imagelocation']; echo "<img id='uploadstyle' src=$imgurl>" . "<br/>"; Basically the user inputs a name into the form on the site and it displays the 'imagelocation' associated with that name. How can I write some MYSQL to select everything in the 'imagelocation' column and display it? Quote Link to comment https://forums.phpfreaks.com/topic/281716-selecting-everything-in-one-row/ Share on other sites More sharing options...
0xMatt Posted August 31, 2013 Share Posted August 31, 2013 I'm not sure what you mean but it sounds like removing the where clause is what you want. $sql = mysql_query("select imagelocation from store"); Quote Link to comment https://forums.phpfreaks.com/topic/281716-selecting-everything-in-one-row/#findComment-1447504 Share on other sites More sharing options...
jasmeet Posted August 31, 2013 Share Posted August 31, 2013 if your image is stored in some folder like uploads/a.jpg you can use <img src="uploads/<?php echo $row['imagelocation']; ?>" /> or something else.. i suppose...!!! Quote Link to comment https://forums.phpfreaks.com/topic/281716-selecting-everything-in-one-row/#findComment-1447513 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.