hi i am getting a error message as
Column 'user_name' in field list is ambiguous
here
is the database
$query = 'CREATE TABLE IF NOT EXISTS user_info (
user_id INTEGER NOT NULL,
user_name VARCHAR(100) NOT NULL,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(200) NOT NULL,
email VARCHAR(50) NOT NULL,
password VARCHAR(50) NOT NULL,
location VARCHAR(100) NOT NULL,
state VARCHAR(50) NOT NULL,
zip VARCHAR(10) NOT NULL,
PRIMARY KEY (user_id)
)
ENGINE = InnoDB';
mysql_query($query, $db) or die (mysql_error($db));
and the php code to retrieve user info from the table
<?php
$query = 'SELECT
user_name, first_name, last_name, email, location, state, zip
FROM
user_info u JOIN
user_info i ON u.user_id = i.user_id
WHERE
user_name = "' . mysql_real_escape_string($_SESSION['user_name'], $db) . '"';
$result = mysql_query($query, $db) or die(mysql_error($db));
$row = mysql_fetch_array($result);
extract($row);
mysql_free_result($result);
mysql_close($db);
?>
<ul>
<li>First Name: <?php echo $first_name; ?></li>
<li>Last Name: <?php echo $last_name; ?></li>
<li>User Name: <?php echo $user_name; ?></li>
<li>Email: <?php echo $email; ?></li>
<li>Location: <?php echo $location; ?></li>
<li>State: <?php echo $state; ?>
<li>Zip Code: <?php echo $zip; ?></li>
</ul>
what does ambiguous means i have google but got different ans.
thanks