Page 1 of 1

change info in database question

Posted: Mon May 14, 2007 6:34 pm
by thefreebielife
okay so i dont know how clear this is going to be to understand but:

so say a user "ostatus" is .6666 but i want to change it to .6667.

what code would actually go into my database and change this? i tried a code but it only changed it on the current page.

if you need more info let me know!

Posted: Mon May 14, 2007 6:39 pm
by John Cartwright
more info, and show code please

Posted: Mon May 14, 2007 6:43 pm
by thefreebielife

Code: Select all

		            <? 

$username = $_SESSION['username'];
$data = mysql_query("SELECT * FROM users WHERE username='$username'")
or die(mysql_error()); 
$info = mysql_fetch_array($data);
$giftid = $info['gid'];
$ostatus = $info['ostatus'];
if ($ostatus == ".6666") { $ostatus = .6667; } 
$deadline = $info['deadline'];
$dead = $info['dead'];
$date = date("F j, Y");
$uid = $info['uId'];
$result = mysql_query("select * from users WHERE rid=$uid");
$count=mysql_num_rows($result);
$result2 = mysql_query("select * from users WHERE rid=$uid && ostatus=1");
$count2=mysql_num_rows($result2);