Hi
Here is the mysql code i'm using to update a database:
$con = mysql_connect("localhost","username","password");
mysql_select_db("db", $con);
$result = mysql_query("SELECT * FROM Add WHERE adder=\"$username\"");
$numResults = mysql_num_rows($result);
if ($numResults > 0) {
while($row = mysql_fetch_array($result)){
echo "<a href=\"/".$row[username]."><".$row[username]."</a>";
}
}
if ($numResults = 0) {
echo "$username hasn\'t added anyone";
}
This is the error I'm getting:
Fatal error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Add WHERE username="82"' at line 1 in /home/public_html/folder/index.php on line 246
Lines 245 - 247:
if ($numResults > 0) {
while($row = mysql_fetch_assoc($result)){
echo "<a href=\"/".$row[username]."><".$row[username]."</a>";
Any ideas why this is happening??
Thanks in advance