Hello. I have a script which should work, but I cannot get it to work. I have verified that I have the variables present, and when the query runs, I had it print out the compare variable along with the strored variable, but for some reason, even though the two variables are identical, it will not follow thru with the output statement. perhaps it is just some little thing I am not seeing?
Here is the code:
<?php
session_start();
include "db_config.php";
mysql_select_db(iceregen_MStudio);
if ($_SESSION['Valid'] <> true) {
header("Location: user_display.php");
}
echo '<body bgcolor="#000000">';
$ProfileName = $_GET['profile'];
$query = "SELECT UserID, UserName, password, Email, datejoin, ULevel, random, verified, profile, description, picture FROM users";
$result = mysql_query($query);
echo $ProfileName;
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
if ($ProfileName == $row['UserName'])
{
$Desribe = $row['description'];
echo '<table border="2" style="border: 2 solid #800000; padding: 1" width="70%" bgcolor="#CCCCCC">';
echo ' <tr>';
echo ' <td width="100%"><font face="Arial" color="#000000">UserName : <font face="Arial" color="#FF0000">' . $ProfileName . '</td>';
echo ' </tr>';
echo ' <tr>';
echo ' <td width="100%"><font face="Arial" color="#000000">UserProfile : <font face="Arial" color="#FF0000">' . $row['description'] . '</td>';
echo ' </tr>';
}
}
?>
I dont understand why the comparison is not coming true. As I said, I tried modifying it to comment out the 'if' condition, and watched it print out all the various usernames, and the correct one matched up visually, but the if statement isnt following thu.
Help!
Ice