Page 2 of 2

feyd

Posted: Wed Jul 14, 2004 4:03 am
by fresh
were you guys holding that info back on purpose... lol, your going to give me grey hair man... :) thanks alot for your help feyd and weirdan, you guys got it working for me... regards

hey by the way could you show me how to add to it, right now it's just over writing:

Code: Select all

<?php
require('dbconnect.php');
require('check_login.php');
$pts = 100;
$uname = $_GET['uname'];
$pass = $_GET['pass'];
if($pass != "test") {

die("wrong");

} else {
$sob = "SELECT users FROM points WHERE username='".$uname."'";
$sql = "UPDATE users SET points='".$sob."+".$pts."' WHERE username='".$uname."'";
$sun = @mysql_query($sql) or die(mysql_error());

echo "<center>".$sun."</center>"; 
}
?>
thanks alot :)

Posted: Wed Jul 14, 2004 4:23 am
by feyd
what's the point of the $sob variable you have in that?

...

Posted: Wed Jul 14, 2004 4:31 am
by fresh
to get the value of the point row for that specific user... what would you do??

edit: do you mean whats the sob stand for??? haha select or bust :)

Posted: Wed Jul 14, 2004 4:36 am
by feyd

Code: Select all

$sql = "UPDATE `users` SET `points` = `points`+ {$pts} WHERE `username` = '{$uname}'";

yes

Posted: Wed Jul 14, 2004 5:08 am
by fresh
finally, after 6 hours or so, I finally successfully updated the right row with the right outcome!! Thanks to feyd and weirdan for putting up with me, feyd i need to read the same books you do, I would never of thought to code that like you did with the brackets and such... like always I appreciate the help and learning experience ;)

Posted: Wed Jul 14, 2004 6:06 am
by feyd
the only book I "read": http://php.net