Jump to content

missing something


chanfuterboy

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.