matvespa Posted July 3, 2010 Share Posted July 3, 2010 Hi guys. Im having problem validating user availability on php and ajax. Below is my code: if($validateValue !="[email protected]"){ // validate?? $arrayToJs[2] = "true"; // RETURN TRUE echo '{"jsonValidateReturn":'.json_encode($arrayToJs).'}'; // RETURN ARRAY WITH success } This code works fine. But i want to change it to validate the value of the user email in my db instead of array in the code. I manage to display out my user email in that page. Below is the code for that: $result = mysql_query("SELECT * FROM user_registered"); while($row = mysql_fetch_array($result)) { echo $row['Email']; } But when i combine the code tgt, it seem not to be working...the code for the combination is below: $result = mysql_query("SELECT * FROM user_registered"); while($row = mysql_fetch_array($result)) { echo [b]$row['Email'][/b]; } if($validateValue != [b]$row['Email'][/b]){ // validate?? $arrayToJs[2] = "true"; // RETURN TRUE echo '{"jsonValidateReturn":'.json_encode($arrayToJs).'}'; // RETURN ARRAY WITH success } Link to comment https://forums.phpfreaks.com/topic/206600-validate-user-availability-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.