instead of starting a new topic, I'll just ask in here...
http://www.ixifx.net/members.php?page=edit&userID=guest
the password for the guest account is "password" w/o quotes, if you're interested in testing it
code:
case "edit":
$SQL = mysql_connect("server", "user", "pass");
mysql_select_db("ixifx_net") or die("Unable to select database");
$Data = mysql_db_query("ixifx_net","SELECT * FROM members WHERE userID='$userID'");
$AA = mysql_fetch_array($Data, MYSQL_ASSOC);
$password = $AA["password"];
$joined = $AA["joined"];
$from = $AA["from"];
$about = $AA["about"];
$sig = $AA["sig"];
if($REQUEST_METHOD == "POST"){
$valid = true;
if(!trim($pass)){
$errString .= '<font color="#FF0000"> You must enter a Password.</font><br>';
$valid = false;
}
if($valid == false){
echo "<h2> $errString </h2>\n";
}else{
if ($pass == $password) {
$ins = "UPDATE members SET from='$newfrom', about='$newabout', sig='$newsig' WHERE userID='$userID '";
if (mysql_db_query("ixifx_net",$ins)){
$return = 'Edit Complete';
$errString = 'Thank you for posting';
}else{
$return = 'Edit Failed';
$errString .= mysql_error();
}
}else{
$errString .= 'Could not log in';
}
echo $return;
echo "<br>";
echo $errString;
echo "<br>";
echo "<a href=\"members.php?page=view&userID=$userID\">Back</a>";
}
}else{
?>
<form action="members.php?page=edit&userID=<? echo $userID ?>" method="post">
<table width="100%">
<tr>
<td width="30%">User ID:</td>
<td align="right">
<? echo $userID ?>
</td>
</tr>
<tr>
<td>Joined:</td>
<td align="right">
<? echo $joined ?>
</td>
</tr>
<tr>
<td>From:</td>
<td align="right">
<input type="text" name="newfrom" value="<? echo $from ?>" size="36" />
</td>
</tr>
<tr>
<td valign="top">About:</td>
<td align="right">
<textarea name="newabout" cols="32" rows="4"><? echo $about ?></textarea>
</td>
</tr>
<tr>
<td valign="top">Sig:</td>
<td align="right">
<textarea name="newsig" cols="32" rows="3"><? echo $sig ?></textarea>
</td>
</tr>
<tr>
<td>Password:</td>
<td align="right">
<input type="password" name="pass" value="" size="16" />
</td>
</tr>
<tr>
<td align="right" colspan="2">
<input type="submit" value="Submit" />
</td>
</tr>
</table>
</form>
<?
}
break;
the error I'm getting looks like this:
quote:
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 'from='', about='123', sig='I don\'t belong here' WHERE userID='
and it happens when I try to update the user profile. the query is on line 21 of the code posted above
I've tried changing variable names for fear I was using a reserved variable, I've tried toying with the spacing and quotes, I've looked for examples of working code, but all I kept getting was the syntax copied verbatim from www.mysql.com (which I've said before is overly complicated for a country bumpkin like myself). I'm not sure what in the world I'm doing wrong, and I've asked several people for help via IM and nobody could seem to find my error.
so, please, what am I doing wrong?

Life is too short, so love the one you got (Bradley Nowell)