chanfuterboy Posted August 8, 2009 Share Posted August 8, 2009 hi, can someone help me print the 2 text and 1 picture? <?php $picture=$_SESSION['username']; $query = mysql_query("SELECT * FROM members WHERE picture='$picture'"); $row = mysql_fetch_assoc($query); $location = $row['picture']; $location1 = $row['articlename']; $location2 = $row['articlecolor']; echo "<img src='$location' width='100' height='100'>"; echo "<b> '$location1'.</b>"; echo "<b> '$location2'.</b>"; ?> Link to comment https://forums.phpfreaks.com/topic/169390-missing-something/ Share on other sites More sharing options...
GingerRobot Posted August 8, 2009 Share Posted August 8, 2009 The only thing i can see obviously wrong with your code is that you've not placed a call to session_start at the top of your code. Beyond that, you'll actually have to tell us what's wrong, what you want to happen, what isn't happening, what is happening etc. Link to comment https://forums.phpfreaks.com/topic/169390-missing-something/#findComment-893771 Share on other sites More sharing options...
chanfuterboy Posted August 8, 2009 Author Share Posted August 8, 2009 hi, the session_start() is all ready there, the page come with the picture cross in db, no text is print via db. If everything is fine written maybe it is some mistaken in var i think or is something else? Link to comment https://forums.phpfreaks.com/topic/169390-missing-something/#findComment-893774 Share on other sites More sharing options...
GingerRobot Posted August 9, 2009 Share Posted August 9, 2009 I don't know. You still haven't really told us what the problem is. Why don't you take a little more care over your posts and explain things more fully? As before, I can continue to stab in the dark...my next guess (without any more information) is that your query is failing and you have the display of errors turned off. Add the following two lines to the top of your script: error_reporting(E_ALL); ini_set('display_errors','On'); And add some debugging to your query. Replace this line: $query = mysql_query("SELECT * FROM members WHERE picture='$picture'"); With: $query = mysql_query("SELECT * FROM members WHERE picture='$picture'") or trigger_error(mysql_error(),E_USER_ERROR); Link to comment https://forums.phpfreaks.com/topic/169390-missing-something/#findComment-894002 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.