ok guys i have attached my php file for creating a new user-member everytime i try to make a new one i get an error telling me that the password already exists even if its not! so any ideas? if u want any help about the file or there is sthing u dont understand plz let me know!
you should take that part out... its stupid to check it the password already exists... the password doesnt HAVE to be unique from every other user... the password is linked to the username so the two have to match up...
bobb1589 is correct - dont check to see if just the password exists. Also the following logic is incorrect: else if ($password = $row['pass']) PHP: The single equals sign assigns the value in $row['pass'] to the variable $password. You need to use two equals signs to compare. Brew
ok done! but now creates the member but not giving him status! every new one record takes status 0... any ideas about that?
This code: $access = $_POST['status']; PHP: should be this: $access = $_POST['Status']; PHP: Note the captial 'S'. Brew
i checked phpmyadmin and it has been created a new 1 record with the following: memID name status 11 anima 1 i think the problem has to do with: f (mysql_num_rows($result) == 1){ $row = mysql_fetch_array($result); $_SESSION['username'] = $username; $_SESSION['memID'] = $row['memID']; $_SESSION['login'] = true; if($row['status'] == 1){ $_SESSION['status'] = 1; } elseif($row['status'] == 2){ $_SESSION['status'] = 2; } elseif($row['status'] == 3){ $_SESSION['status'] = 3; } elseif($row['status'] == 4){ $_SESSION['status'] = 4; } else{ $_SESSION['status'] = false; } the rows here.I am new in php so i dont know how to do what u told me!
ok, try echoing the values that are returned from the sql query and compare them to what you think they should be. Brew
ok. Use the code below f (mysql_num_rows($result) == 1){ $row = mysql_fetch_array($result); $_SESSION['username'] = $username; $_SESSION['memID'] = $row['memID']; $_SESSION['login'] = true; // add the line below to print out what is retreived from the query print_r( $row ); if($row['status'] == 1){ $_SESSION['status'] = 1; } elseif($row['status'] == 2){ $_SESSION['status'] = 2; } elseif($row['status'] == 3){ $_SESSION['status'] = 3; } elseif($row['status'] == 4){ $_SESSION['status'] = 4; } else{ $_SESSION['status'] = false; } PHP: Brew
post the result that the code gave. If you didnt see anything different, then that code was not executed. Brew
ok man all my problems are solved now everything works just perfect hope to find u here any time i have prob