I get this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\black_site\profile.php on line 5
whenever i use this script:
<? include $_SERVER['DOCUMENT_ROOT']."/black_site/layout/top.php"; ?>
<?
$user = $_GET['username'];
$query = mysql_query("SELECT `id`, `username`, `email`, `class`, `msn`, `icq`, `yaim`, `site`, `site_name`, `age`, `date_born`, `interests`, `ocupation`, `postition` FROM user_pro WHERE username='$user");
while ($row = mysql_fetch_array($query)) {
?>
<table border="1" width="500">
<tr>
<td width="250">
MSN: <? print $msn; ?>
</td>
<td width="250">
ICQ: <? print $icq; ?>
</td>
</tr>
<tr>
<td width="250">
Yahoo IM: <? print $row['yaim']; ?>
</td>
<td width="250">
Website: <a href="<? print $row['site']; ?>"><? print $row['site_name']; ?></a>
</td>
</tr>
<tr>
<td width="250">
Age: <? print $row['age']; ?>
</td>
<td width="250">
Date of Birth: <? print $row['dob']; ?>
</td>
</tr>
<tr>
<td width="250">
Ocupation: <? print $row['ocupation']; ?>
</td>
<td width="250">
Interests:<br />
<? print $row['interests']; ?>
</td>
</tr>
</table>
<?
}
include $_SERVER['DOCUMENT_ROOT']."/black_site/layout/bottum.php"; ?>
does anyone know whats wrong?