Jump to content


Photo

can someone tell me why this don't work..


  • Please log in to reply
2 replies to this topic

#1 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 07 May 2006 - 11:36 PM

if the person got a record this supost to change it if they cahng eit but instead it just puts a new one..
$checkpic=mysql_query("SELECT * FROM userpic where username='$actuser' LIMIT 1")or die(mysql_error());
if($check > 0){
$update=mysql_query("UPDATE userpic  SET  name='$filename',username='$actuser',datetime='$datetime', size='$filesize', type='$filetype', path='$filepath' WHERE username='$actuser'");
}elseif($check<=0){
$sql2=mysql_query("INSERT INTO userpic (name,username,datetime, size, type, path)VALUES('$filename','$actuser','$datetime','$filesize', '$filetype', '$filepath')");
header('Location: http://www.travesurahouse.com/testphp/');
}
}
?>


#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 07 May 2006 - 11:49 PM

Looking at the code, I'd say it's because the test if ($check > 0) fails. Take a look at where $check is determined and if/how it gets to this script.
Legend has it that reading the manual never killed anyone.
My site

#3 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 08 May 2006 - 05:39 AM

damn ! thanx..




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users