Hi all i am trying to update the currant logged in users details,
i select the info from the database with this?
[code=php]<?
//SQL QUERY TO SELECT THE USER LOGGED IN
$sql2 = “SELECT FROM users WHERE username = ‘”. $_SESSION[‘uname’] .”‘”;
$sql2 = mysql_query($sql2);
//WHILE USERS ARE IN THE DATABASE DO THE FOLLOWING
while($result2 = mysql_fetch_assoc($sql2)) { ?>
Then list and populate the feilds with this data like so
[code=php]<input value=”<?php print($result2[‘name’]); ?>” type=”text” style=”width:260px” name=”name” tab-index=”1″></php>
then alter the the table with this code
[code=php] $putinguestbook=”UPDATE users SET
name = $name,
email = $email,
username = $username,
password = $password,
perms = $perms,
phone1 = $phone1,
phone2 = $phone2,
address = $address,
city = $city,
country = $country,
served = $served,
unit = $unit,
snumber = $snumber,
year = $year,
rank = $rank,
partner = $partner,
comments = $comments WHERE id = ‘”. $_SESSION[‘uname’] .”‘ “;
mysql_query($putinguestbook);
BUT I GET THIS ERROR
[code]Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/sheldon/public_html/test/mva/modify.php on line 14
Attached is the file, can any one tell me what is wrong???
Thanks Sheldon
[upl-file uuid=f8de2ba6-57c2-4a40-a95b-805f18ef7bb5 size=3kB]modify.zip