change info in database question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
thefreebielife
Forum Contributor
Posts: 126
Joined: Thu Apr 26, 2007 2:59 pm

change info in database question

Post 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!
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

more info, and show code please
thefreebielife
Forum Contributor
Posts: 126
Joined: Thu Apr 26, 2007 2:59 pm

Post 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);
Post Reply