View Single Post
Old 02-10-2005, 09:46 PM  
calmlikeabomb
Confirmed User
 
calmlikeabomb's Avatar
 
Join Date: May 2004
Location: SW Palm Bay, Florida
Posts: 1,323
Code:
$username = $_COOKIE['username']; //What user are we updating ?
$chattext = $_POST['chattext']; //What text did this user submit ?

//Let's check to see if this username is in the table.
$usernamequery = "UPDATE members set chattext = 'chattext{$_POST['chattext']}' WHERE username='$username'";
$username = @mysql_query($usernamequery);
$numusername = mysql_affected_rows($username);//Does this username exist ?

if ($numusername = 0) {//If username doesn't exist add to table.
$adduserquery = "INSERT INTO members (username,chattext) VALUES ('$username', '$chattext');
}
It's pretty much the same on system resources needed.....

Note the bold.
__________________
subarus.

Last edited by calmlikeabomb; 02-10-2005 at 09:49 PM..
calmlikeabomb is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote