this is my code and i don't see the problem every time am trying to edit something it gives empty record <?php $conn=mysqli_connect("localhost","root","","cars"); $result=mysqli_query($conn,"select * from login where username='".$username."'"); $record=mysqli_fetch_array($result,MYSQLI_ASSOC); $fields=mysqli_fetch_fields($result); $id=addslashes($_REQUEST['id']); $username=addslashes($_REQUEST['username']); $password=addslashes($_REQUEST['password']); $gender=addslashes($_REQUEST['gender']); $email=addslashes($_REQUEST['email']); $sql=mysqli_query($conn,"UPDATE login SET email = '".$email."' , id ='".$id."' Where username = '".$username."' "); if(!$sql){echo"Wrongggggg";} PHP:
Is $username actually set on line 3? And why do you have an extra space at the end of your final query?
yes the page sees the username in the url extra space to avoid being wrong! my probelm when i click update it gives empty my records in the database either ID to 0 and email to empty
Are you sure id and email are being sent by the url correctly? Try echo $_REQUEST['id'] to see if it's working. I don't see why you need the space though...
it worked thnxx i wrote echo $email after the code and it saw it but plz could u help me to output this header("location:showmydetails?username=<?php echo $username;?>"); the syntax driving me crazy Edit/Delete Message
header("location:showmydetails?username=<?php echo $username;?>"); PHP: You don't need the <?php echo bit as header is already within php Just this will do the trick header("location:showmydetails?username=$username"); PHP: