DB data not showing up

I am building a music community website, I have built the registration page and it works perfectly, the login script works fine, but when I go to the profile.php page, it doesn’t seem to be fetching the data from the database and displaying it on the page, where it’s supposed to say “Tom’s Location Details”, it just displays “.s Location Details” and so on, the pic, youtube channel, nothing is being displayed, I have looked over the code for days and can’t seem to find where the missing variable is beig created, or what is happening.

here is the first part of the php code for fetching the data


<?php 
session_start(); 

include_once "scripts/connect_to_mysql.php";

$id = "";
$username = "";
$firstname = "";
$lastname = "";
$country = "";    
$state = "";
$city = "";
$zip = "";
$bio_body = "";
$bio_body = "";
$website = "";
$youtube = "";
$user_pic = "";
$blabberDisplayList = "";

if ($_GET['id']) {
    
     $id = $_GET['id'];

} else if (isset($_SESSION['id'])) {
    
     $id = $_SESSION['id'];

} else {
    
   include_once "index.php";
   exit();
}
$id = mysql_real_escape_string($id);
$id = eregi_replace("`", "", $id);
$sql = mysql_query("SELECT * FROM myMembers WHERE id='$id'");

while($row = mysql_fetch_array($sql)){ 

    $username = $row["username"];
    $firstname = $row["firstname"];
    $lastname = $row["lastname"];
    $country = $row["country"];    
    $state = $row["state"];
    $city = $row["city"];
    $zip = $row["zip"];
    $email = $row["email"];
    //$email = "<a href=\\"mailto:$email\\"><u><font color=\\"#006600\\">Mail</font></u></a>";    
    $sign_up_date = $row["sign_up_date"];
    $sign_up_date = strftime("%b %d, %Y", strtotime($sign_up_date));
    $last_log_date = $row["last_log_date"];
    $last_log_date = strftime("%b %d, %Y", strtotime($last_log_date));    
    $bio_body = $row["bio_body"];    
    $website = $row["website"];
    $youtube = $row["youtube"];
    
    $check_pic = "members/$id/image01.jpg";
    $default_pic = "members/0/image01.jpg";
    if (file_exists($check_pic)) {
    $user_pic = "<img src=\\"$check_pic\\" width=\\"300px\\" />"; 
    } else {
    $user_pic = "<img src=\\"$default_pic\\" width=\\"300px\\" />"; 
    }
    
    if ($youtube == "") {
    $youtubeChannel = "<br />This user has no YouTube channel yet.";
    } else {
    $youtubeChannel = ' <script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/youtube.xml&up_channel=' . $youtube . '&synd=open&w=290&h=370&title=&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>  '; 
    }    

} 
$style_sheet = "default";
?>

thanks for fixing that

I can’t see where you are attempting to echo anything. Where did you try to display this data?

Looks as though you’re just collecting a bunch of variables.

Also this part:


$id = mysql_real_escape_string($id);
$id = eregi_replace("`", "", $id);
$sql = mysql_query("SELECT * FROM myMembers WHERE id='$id'");

Surely $id is an integer ID? No need to treat it like a string. If it does have a ` attached, use [fphp]str_replace[/fphp] instead of eregi_replace


$id = str_replace('`', '', $id);
$id = (int)$id;
if( $id == 0 ) {
  exit('Invalid member');
}
$query = "SELECT * FROM myMembers WHERE id=$id";
if( !$sql = mysql_query($query) ) {
    exit('A database error occurred');
}

all the echo code is lower in the page, I guess I should post the entire page, let me get it

all the printing is later in the page, I guess I will post the entire page:


```php
<?php 
session_start(); 

include_once "scripts/connect_to_mysql.php";

$id = "";
$username = "";
$firstname = "";
$lastname = "";
$country = "";	
$state = "";
$city = "";
$zip = "";
$bio_body = "";
$bio_body = "";
$website = "";
$youtube = "";
$user_pic = "";
$blabberDisplayList = "";

if ($_GET['id']) {
	
     $id = $_GET['id'];

} else if (isset($_SESSION['id'])) {
	
	 $id = $_SESSION['id'];

} else {
	
   include_once "index.php";
   exit();
}
$id = mysql_real_escape_string($id);
$id = eregi_replace("`", "", $id);
$sql = mysql_query("SELECT * FROM myMembers WHERE id='$id'");

while($row = mysql_fetch_array($sql)){ 

	$username = $row["username"];
	$firstname = $row["firstname"];
	$lastname = $row["lastname"];
	$country = $row["country"];	
	$state = $row["state"];
	$city = $row["city"];
	$zip = $row["zip"];
	$email = $row["email"];
	//$email = "<a href=\\"mailto:$email\\"><u><font color=\\"#006600\\">Mail</font></u></a>";	
	$sign_up_date = $row["sign_up_date"];
    $sign_up_date = strftime("%b %d, %Y", strtotime($sign_up_date));
	$last_log_date = $row["last_log_date"];
    $last_log_date = strftime("%b %d, %Y", strtotime($last_log_date));	
	$bio_body = $row["bio_body"];	
	$website = $row["website"];
	$youtube = $row["youtube"];
	
	$check_pic = "members/$id/image01.jpg";
	$default_pic = "members/0/image01.jpg";
	if (file_exists($check_pic)) {
    $user_pic = "<img src=\\"$check_pic\\" width=\\"300px\\" />";
	} else {
	$user_pic = "<img src=\\"$default_pic\\" width=\\"300px\\" />";
	}
	
	if ($youtube == "") {
    $youtubeChannel = "<br />This user has no YouTube channel yet.";
	} else {
	$youtubeChannel = ' <script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/youtube.xml&up_channel=' . $youtube . '&synd=open&w=290&h=370&title=&border=%23ffffff%7C3px%2C1px+solid+%23999999&output=js"></script>  '; 
	}	

} 
$style_sheet = "default";
?>
<?php

$blab_outout_msg = "";
if ($_POST['blab_field'] != ""){
	
	 
	 $sqlDeleteBlabs = mysql_query("SELECT * FROM blabbing WHERE mem_id='$id' ORDER BY blab_date DESC LIMIT 50");
	 
	 $bi = 1;
	 
	 while ($row = mysql_fetch_array($sqlDeleteBlabs)) {
		 
		 $blad_id = $row["id"];
		 if ($bi > 20) {
			 
			  $deleteBlabs = mysql_query("DELETE FROM blabbing WHERE id='$blad_id'");
		 }
		 $bi++;
	 }
	 
	
     $blab_field = $_POST['blab_field'];
	 $blab_field = stripslashes($blab_field);
	 $blab_field = strip_tags($blab_field);
	 $blab_field = mysql_real_escape_string($blab_field);
	 $blab_field = eregi_replace("'", "'", $blab_field);
	 
	 $sql = mysql_query("INSERT INTO blabbing (mem_id, the_blab, blab_date) 
     VALUES('$id','$blab_field', now())")  
     or die (mysql_error());
	 
	 $blab_outout_msg = "Your Blab has been posted!";
}

?>




<?php
$the_blab_form = "";
if (isset($_SESSION['id'])) {
	
	if ($_SESSION['id'] == $id){
	 $the_blab_form = '
	 ' . $blab_outout_msg . '

<form action="profile.php" method="post" enctype="multipart/form-data" name="blab_from">
<textarea name="blab_field" rows="3" style="width:97%;"></textarea>
Blab away  (220 char max) <input name="submit" type="submit" value="submit" />
</form>';
	}
}

?>

<?php
$sql_blabs = mysql_query("SELECT id, mem_id, the_blab, blab_date FROM blabbing WHERE mem_id='$id' ORDER BY blab_date DESC LIMIT 20");

while($row = mysql_fetch_array($sql_blabs)){
	
	$blabid = $row["id"];
	$uid = $row["mem_id"];
	$the_blab = $row["the_blab"];
	$blab_date = $row["blab_date"];
	$blab_date = strftime("%b %d, %Y, %Y %I:%M:%S %p", strtotime($blab_date));
	
				$blabberDisplayList .= '
			        <table width="100%" align="center" cellpadding="4" bgcolor="#A6D2FF">
        <tr>
          <td width="93%" bgcolor="#D9ECFF"><span style="font-size:10px; font-weight:bold; color:#A6A6A6;">' . $blab_date . '</span><br />
            ' . $the_blab . '</td>
        </tr>
      </table>';
	
}

?>




```html
<body>
<?php include_once "header_template.php"; ?>
<table width="950" align="center">
  <tr>
    <td width="758"><br />
      <table width="90%" border="0" align="center" cellpadding="6">
      <tr>
        <td width="48%" valign="top">
		<?php print "$firstname $lastname"; ?>
        <br />
		<?php print "$user_pic"; ?>
        <br />
        Member Since: <?php print "$sign_up_date"; ?>
        <br />
       <?php print "$youtubeChannel"; ?>
       </td>
        <td width="52%" valign="top">
        <br />
		<strong><u><?php print "$firstname $lastname"; ?>'s Blabs:</u></strong>
        <br />
        <?php print "$the_blab_form"; ?>
        <div style="width:100%; height:180px; overflow:auto; overflow-x:hidden;">
        <?php print "$blabberDisplayList"; ?>
        </div>
		<br />
        <br />
		<strong><u><?php print "$firstname $lastname"; ?>'s Location Details:</u></strong>
        <br />
		<?php print "$city"; ?> &bull; <?php print "$state"; ?> &bull; <?php print "$country"; ?>
        <br />
		<br />
		<strong><u>About <?php print "$firstname $lastname"; ?></u></strong>
        <br />
		<?php print "$bio_body"; ?>
        <br />

        
        </td>
      </tr>
      <tr>
        <td colspan="2" valign="top">&nbsp;</td>
        </tr>
      </table>
      <p><br />
        <br />
    </p>
      <p>&nbsp;</p>
      <p><br />
        <br />
        <br />
        <br />
        <br />
        </p></td>
    <td width="180" valign="top"><?php include_once "right_AD_template.php"; ?></td>
  </tr>
</table>
<?php include_once "footer_template.php"; ?>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Description" content="Profile for <?php print "$firstname $lastname"; ?>" />
<meta name="Keywords" content="<?php print "$firstname, $lastname, $city, $state, $country"; ?>" />
<meta name="rating" content="General" />
<meta name="ROBOTS" content="All" />
<title>Site Profile for <?php print "$firstname $lastname"; ?></title>
<link href="style_profiles/<?php print "$style_sheet"; ?>.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>

<body>
<?php include_once "header_template.php"; ?>
<table width="950" align="center">
  <tr>
    <td width="758"><br />
      <table width="90%" border="0" align="center" cellpadding="6">
      <tr>
        <td width="48%" valign="top">
		<?php print "$firstname $lastname"; ?>
        <br />
		<?php print "$user_pic"; ?>
        <br />
        Member Since: <?php print "$sign_up_date"; ?>
        <br />
       <?php print "$youtubeChannel"; ?>
       </td>
        <td width="52%" valign="top">
        <br />
		<strong><u><?php print "$firstname $lastname"; ?>'s Blabs:</u></strong>
        <br />
        <?php print "$the_blab_form"; ?>
        <div style="width:100%; height:180px; overflow:auto; overflow-x:hidden;">
        <?php print "$blabberDisplayList"; ?>
        </div>
		<br />
        <br />
		<strong><u><?php print "$firstname $lastname"; ?>'s Location Details:</u></strong>
        <br />
		<?php print "$city"; ?> &bull; <?php print "$state"; ?> &bull; <?php print "$country"; ?>
        <br />
		<br />
		<strong><u>About <?php print "$firstname $lastname"; ?></u></strong>
        <br />
		<?php print "$bio_body"; ?>
        <br />

        
        </td>
      </tr>
      <tr>
        <td colspan="2" valign="top">&nbsp;</td>
        </tr>
      </table>
      <p><br />
        <br />
    </p>
      <p>&nbsp;</p>
      <p><br />
        <br />
        <br />
        <br />
        <br />
        </p></td>
    <td width="180" valign="top"><?php include_once "right_AD_template.php"; ?></td>
  </tr>
</table>
<?php include_once "footer_template.php"; ?>
</body>
</html>

I collected all of this data on the register page, it was all written to the database, then when you login, the profile page should have all the data fetched from the database and put into the html page I posted here, I appologize for not posting anything below the php script initially.

What output does the below yield?


&lt;?php 
session_start(); 

include_once "scripts/connect_to_mysql.php";

$id = "";
$username = "";
$firstname = "";
$lastname = "";
$country = "";    
$state = "";
$city = "";
$zip = "";
$bio_body = "";
$bio_body = "";
$website = "";
$youtube = "";
$user_pic = "";
$blabberDisplayList = "";

if ($_GET['id']) {
    
     $id = $_GET['id'];

} else if (isset($_SESSION['id'])) {
    
     $id = $_SESSION['id'];

} else {
    
   include_once "index.php";
   exit();
}
$id = mysql_real_escape_string($id);
$id = eregi_replace("`", "", $id);
$sql = mysql_query("SELECT * FROM myMembers WHERE id='$id'");

if($sql === false) {
     echo mysql_error();
     exit;
}

while($row = mysql_fetch_array($sql)){ 
    echo '<pre>',print_r($row),'</pre>';
}    
$style_sheet = "default";
?>

Also, this is wrong:


"SELECT * FROM myMembers WHERE id='$id'"

should be:


"SELECT * FROM myMembers WHERE id=$id"

notice: no single quotes around the numeric value.

this:


$id = mysql_real_escape_string($id);
$id = eregi_replace("`", "", $id);

Can be scrapped, instead do this:


if ($_GET['id']) {
    
     $id = (int) $_GET['id'];

} else if (isset($_SESSION['id'])) {
    
     $id = (int) $_SESSION['id'];

} else {
    
   include_once "index.php";
   exit();
}

notice: (int) - casting a string that is not numeric to an integer will yield 0.

I tried the changes you mentioned, it still doesn’t display any of the User’s info into the profile page. The profile page loads just fine, but there is no user data printed on the page, as I said in the first post I made, it’s supposed to say something like “Tom’s Location Details” but all it does is " 's Location Details ", could it be possible that between the registration page, the login script and the profile page that something I have missed could be wrong?, I am at an absolute loss, been working on just this page for about a week.

so here is my code now both html and php

<?php 
session_start(); 

include_once "scripts/connect_to_mysql.php";

$id = "";
$username = "";
$firstname = "";
$lastname = "";
$country = "";	
$state = "";
$city = "";
$zip = "";
$bio_body = "";
$bio_body = "";
$website = "";
$youtube = "";
$user_pic = "";
$blabberDisplayList = "";

if ($_GET['id']) {
    
     $id = (int) $_GET['id'];

} else if (isset($_SESSION['id'])) {
    
     $id = (int) $_SESSION['id'];

} else {
    
   include_once "index.php";
   exit();

}
$sql = mysql_query("SELECT * FROM myMembers WHERE id=$id");

while($row = mysql_fetch_array($sql)){ 

	$username = $row["username"];
	$firstname = $row["firstname"];
	$lastname = $row["lastname"];
	$country = $row["country"];	
	$state = $row["state"];
	$city = $row["city"];
	$zip = $row["zip"];
	$email = $row["email"];
	//$email = "<a href=\\"mailto:$email\\"><u><font color=\\"#006600\\">Mail</font></u></a>";	
	$sign_up_date = $row["sign_up_date"];
    $sign_up_date = strftime("%b %d, %Y", strtotime($sign_up_date));
	$last_log_date = $row["last_log_date"];
    $last_log_date = strftime("%b %d, %Y", strtotime($last_log_date));	
	$bio_body = $row["bio_body"];	
	$website = $row["website"];
	$youtube = $row["youtube"];
	
	$check_pic = "members/$id/image01.jpg";
	$default_pic = "members/0/image01.jpg";
	if (file_exists($check_pic)) {
    $user_pic = "<img src=\\"$check_pic\\" width=\\"300px\\" />";
	} else {
	$user_pic = "<img src=\\"$default_pic\\" width=\\"300px\\" />";
	}
	
	if ($youtube == "") {
    $youtubeChannel = "<br />This user has no YouTube channel yet.";
	} else {
	$youtubeChannel = ' <script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/youtube.xml&amp;up_channel=' . $youtube . '&amp;synd=open&amp;w=290&amp;h=370&amp;title=&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script>  '; 
	}	

} 
$style_sheet = "default";
?>
<?php

$blab_outout_msg = "";
if ($_POST['blab_field'] != ""){
	
	 
	 $sqlDeleteBlabs = mysql_query("SELECT * FROM blabbing WHERE mem_id='$id' ORDER BY blab_date DESC LIMIT 50");
	 
	 $bi = 1;
	 
	 while ($row = mysql_fetch_array($sqlDeleteBlabs)) {
		 
		 $blad_id = $row["id"];
		 if ($bi > 20) {
			 
			  $deleteBlabs = mysql_query("DELETE FROM blabbing WHERE id='$blad_id'");
		 }
		 $bi++;
	 }
	 
	
     $blab_field = $_POST['blab_field'];
	 $blab_field = stripslashes($blab_field);
	 $blab_field = strip_tags($blab_field);
	 $blab_field = mysql_real_escape_string($blab_field);
	 $blab_field = eregi_replace("'", "'", $blab_field);
	 
	 $sql = mysql_query("INSERT INTO blabbing (mem_id, the_blab, blab_date) 
     VALUES('$id','$blab_field', now())")  
     or die (mysql_error());
	 
	 $blab_outout_msg = "Your Blab has been posted!";
}

?>




<?php
$the_blab_form = "";
if (isset($_SESSION['id'])) {
	
	if ($_SESSION['id'] == $id){
	 $the_blab_form = '
	 ' . $blab_outout_msg . '

<form action="profile.php" method="post" enctype="multipart/form-data" name="blab_from">
<textarea name="blab_field" rows="3" style="width:97%;"></textarea>
Blab away  (220 char max) <input name="submit" type="submit" value="submit" />
</form>';
	}
}

?>

<?php
$sql_blabs = mysql_query("SELECT id, mem_id, the_blab, blab_date FROM blabbing WHERE mem_id='$id' ORDER BY blab_date DESC LIMIT 20");

while($row = mysql_fetch_array($sql_blabs)){
	
	$blabid = $row["id"];
	$uid = $row["mem_id"];
	$the_blab = $row["the_blab"];
	$blab_date = $row["blab_date"];
	$blab_date = strftime("%b %d, %Y, %Y %I:%M:%S %p", strtotime($blab_date));
	
				$blabberDisplayList .= '
			        <table width="100%" align="center" cellpadding="4" bgcolor="#A6D2FF">
        <tr>
          <td width="93%" bgcolor="#D9ECFF"><span style="font-size:10px; font-weight:bold; color:#A6A6A6;">' . $blab_date . '</span><br />
            ' . $the_blab . '</td>
        </tr>
      </table>';
	
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Description" content="Profile for <?php print "$username"; ?>" />
<meta name="Keywords" content="<?php print "$username"; ?>" />
<meta name="rating" content="General" />
<meta name="ROBOTS" content="All" />
<title>Site Profile for <?php print "$username"; ?></title>
<link rel="icon" href="favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
</head>

<body>
<?php include_once "header1_template.php"; ?>
<table width="950" align="center">
  <tr>
    <td width="758"><br />
      <table width="90%" border="0" align="center" cellpadding="6">
      <tr>
        <td width="48%" valign="top">
		<?php print "$username"; ?>
        <br />
		<?php print "$user_pic"; ?>
        <br />
        Member Since: <?php print "$sign_up_date"; ?>
        <br />
       <?php print "$youtubeChannel"; ?>
       </td>
        <td width="52%" valign="top">
        <br />
		<strong><u><?php print "$firstname $lastname"; ?>'s Blabs:</u></strong>
        <br />
        <?php print "$the_blab_form"; ?>
        <div style="width:100%; height:180px; overflow:auto; overflow-x:hidden;">
        <?php print "$blabberDisplayList"; ?>
        </div>
		<br />
        <br />
		<strong><u><?php print "$username"; ?>'s Location Details:</u></strong>
        <br />
		<?php print "$city"; ?> &bull; <?php print "$state"; ?> &bull; <?php print "$country"; ?>
        <br />
		<br />
		<strong><u>About <?php print "$username"; ?></u></strong>
        <br />
		<?php print "$bio_body"; ?>
        <br />

        
        </td>
      </tr>
      <tr>
        <td colspan="2" valign="top">&nbsp;</td>
        </tr>
      </table>
      <p><br />
        <br />
    </p>
      <p>&nbsp;</p>
      <p><br />
        <br />
        <br />
        <br />
        <br />
        </p></td>
    <td width="180" valign="top"><?php include_once "right_AD_template.php"; ?></td>
  </tr>
</table>
<?php include_once "footer_template.php"; ?>
</body>
</html>

What did this output – anything? When issues like this occur the code needs to be broken down piece by piece, generally that provides an answer eventually.



&lt;?php 
session_start(); 

include_once "scripts/connect_to_mysql.php";

$id = "";
$username = "";
$firstname = "";
$lastname = "";
$country = "";    
$state = "";
$city = "";
$zip = "";
$bio_body = "";
$bio_body = "";
$website = "";
$youtube = "";
$user_pic = "";
$blabberDisplayList = "";

if ($_GET['id']) {
    
     $id = $_GET['id'];

} else if (isset($_SESSION['id'])) {
    
     $id = $_SESSION['id'];

} else {
    
   include_once "index.php";
   exit();
}
$id = mysql_real_escape_string($id);
$id = eregi_replace("`", "", $id);
$sql = mysql_query("SELECT * FROM myMembers WHERE id='$id'");

if($sql === false) {
     echo mysql_error();
     exit;
}

while($row = mysql_fetch_array($sql)){ 
    echo '&lt;pre&gt;',print_r($row),'&lt;/pre&gt;';
}    
$style_sheet = "default";
?&gt;

it output a syntax error until I removed the single quotes again like you suggested earlier, but after that, it reported no errors at all, so I’ll move to the next section

well, I’m not getting any errors, so am I to assume it must be in the print tags in the html?

maybe there’s something in the login script, because after I login and see there’s nothing on the profile page, if I click on edit profile, it tells me that I am not logged in…

&lt;?php

if ($_POST['email'] != "") {

include_once "connect_to_mysql.php";

$email = $_POST['email'];
$pass = $_POST['pass'];
$remember = $_POST['remember'];

$email = strip_tags($email);
$pass = strip_tags($pass);
$email = mysql_real_escape_string($email);
$pass = mysql_real_escape_string($pass);
$email = eregi_replace("`", "", $email);
$pass = eregi_replace("`", "", $pass);

$pass = md5($pass);


$sql = mysql_query("SELECT * FROM myMembers WHERE email='$email' AND password='$pass' AND email_activated='1'"); 
$login_check = mysql_num_rows($sql);

if($login_check &gt; 0){ 

    while($row = mysql_fetch_array($sql)){ 

        $id = $row["id"];   
        session_register('id'); 
        $_SESSION['id'] = $id;
       
	    $firstname = $row["firstname"];   
        session_register('firstname'); 
        $_SESSION['firstname'] = $firstname;
       
	    $email = $row["email"];   
        session_register('email'); 
        $_SESSION['email'] = $email;
         
        mysql_query("UPDATE myMembers SET last_log_date=now() WHERE id=$id"); 
          
    }
    if($remember == "yes"){
      setcookie("idCookie", $id, time()+60*24*60*60, "/");
      setcookie("firstnameCookie", $firstname, time()+60*24*60*60, "/");
      setcookie("emailCookie", $email, time()+60*24*60*60, "/");
      setcookie("passCookie", $pass, time()+60*24*60*60, "/");
    }	
	$my_msg = "all_good";
    print "return_msg=$my_msg&id=$id&firstname=$firstname";
	
} else {
$my_msg = "no_good";
    print "return_msg=$my_msg"; 
  exit();
}


}
?&gt;

it is not reporting errors.

So… your not seeing an array of data?

Are you certain the row exists in the db? Echo out that query and run it directly from MySQL command prompt – are there any rows in the result set?

maybe there’s something in the login script, because after I login and see there’s nothing on the profile page, if I click on edit profile, it tells me that I am not logged in…

Well… one obvious thing is that unless its somewhere else no call to session_start() is made in that “login script”. Therefore, if you expect the data to be in the session it won’t be. Instead try the other way around and manually pass the ID to the page. If the “profile script” than works you know the problem is with the data not being placed in the session due to not calling session_start() in the “login script”.

there is no array of data whatsoever, and yes the row does exist in the db, I have gone into the db to make sure the id row is there and is the primary set as an integer with auto increment.

now I am going to sound like an idiot, since I am relatively new to php, how do I manually pass the id to the page?

Something like: /whateverthenameogmypageis.php?id(equals)theid

Posting from my iPhone slightly inebriated but (equals) should be an actual equals sign and the Id should be the I’d of the row.

ok, I’m dumb, thanks for that, I should have known how to do that.

anyway, it worked, manually putting the id in worked, everything showed up, it did give me the “Array (” list at the top of the page but everything showed up.

now I have added the session start to the login script, and it still is not working.

if you want to see the data array display u can go to http:Site Profile for TheGeminiRitual

now as I said, the session start has been added to the login script, but still nothing

now, when I click on the view profile button in the flash bar, it goes to /profile.php but doesn’t add the ?id=idnumber after, don’t know if that info helps, I can post the as3 script

stop();

var logOutVars:URLVariables = new URLVariables();

var logOutURL:URLRequest = new URLRequest("scripts/logout.php");
logOutURL.method = URLRequestMethod.POST;
logOutURL.data = logOutVars;

var logOutLoader:URLLoader = new URLLoader;
logOutLoader.dataFormat = URLLoaderDataFormat.VARIABLES;

logOutLoader.addEventListener(Event.COMPLETE, completeLogOut);
logout_btn.addEventListener(MouseEvent.CLICK, logUserOut);


function logUserOut(event:MouseEvent):void{
	
		// Ready the variables here for sending to PHP
   		logOutVars.post_code = "log_out";

		// Send the data to the php file
   		logOutLoader.load(logOutURL);

		welcome_txt.text = "Processing request...";


}
function completeLogOut(event:Event):void{
	
    if (event.target.data.replyMsg == "success") {

			var refreshPage:URLRequest = new URLRequest("javascript:NewWindow=window.location.reload(); NewWindow.focus(); void(0);");
	        navigateToURL(refreshPage, "_self");
        
	}
		
}



///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Code for the View profile Button
var viewProfile:URLRequest = new URLRequest("profile.php");
viewProfile_btn.addEventListener(MouseEvent.CLICK, viewProfileClick);

function viewProfileClick(event:MouseEvent):void {
     navigateToURL(viewProfile, "_self");
}


var editProfile:URLRequest = new URLRequest("edit_profile.php");
edit_btn.addEventListener(MouseEvent.CLICK, editProfileClick);

function editProfileClick(event:MouseEvent):void {
     navigateToURL(editProfile, "_self");
}

I don’t know if this will help

ok, I tried, once again, the earlier suggestions from both of you, here is the modified profile.php code for the gathering of info, it is now displaying “invalid member” when I click on the view profile button

&lt;?php 
session_start(); 

include_once "scripts/connect_to_mysql.php";

$id = "";
$username = "";
$firstname = "";
$lastname = "";
$country = "";    
$state = "";
$city = "";
$zip = "";
$bio_body = "";
$bio_body = "";
$website = "";
$youtube = "";
$user_pic = "";
$blabberDisplayList = "";

if ($_GET['id']) {
    
     $id = (int) $_GET['id'];

} else if (isset($_SESSION['id'])) {
    
     $id = (int) $_SESSION['id'];

} else {
    
   include_once "index.php";
   exit();
}
$id = str_replace('`', '', $id);
$id = (int)$id;
if( $id == 0 ) {
  exit('Invalid member');
}
$query = "SELECT * FROM myMembers WHERE id=$id";
if( !$sql = mysql_query($query) ) {
    exit('A database error occurred');
}

while($row = mysql_fetch_array($sql)){


	$username = $row["username"];
	$firstname = $row["firstname"];
	$lastname = $row["lastname"];
	$country = $row["country"];	
	$state = $row["state"];
	$city = $row["city"];
	$zip = $row["zip"];
	$email = $row["email"];
	//$email = "&lt;a href=\\"mailto:$email\\"&gt;&lt;u&gt;&lt;font color=\\"#006600\\"&gt;Mail&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;";	
	$sign_up_date = $row["sign_up_date"];
    $sign_up_date = strftime("%b %d, %Y", strtotime($sign_up_date));
	$last_log_date = $row["last_log_date"];
    $last_log_date = strftime("%b %d, %Y", strtotime($last_log_date));	
	$bio_body = $row["bio_body"];	
	$website = $row["website"];
	$youtube = $row["youtube"];
	
	$check_pic = "members/$id/image01.jpg";
	$default_pic = "members/0/image01.jpg";
	if (file_exists($check_pic)) {
    $user_pic = "&lt;img src=\\"$check_pic\\" width=\\"300px\\" /&gt;";
	} else {
	$user_pic = "&lt;img src=\\"$default_pic\\" width=\\"300px\\" /&gt;";
	}
	
	if ($youtube == "") {
    $youtubeChannel = "&lt;br /&gt;This user has no YouTube channel yet.";
	} else {
	$youtubeChannel = ' &lt;script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/youtube.xml&amp;up_channel=' . $youtube . '&amp;synd=open&amp;w=290&amp;h=370&amp;title=&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"&gt;&lt;/script&gt;  '; 
	}	

} 
$style_sheet = "default";

?&gt;