Click here to Skip to main content
15,911,531 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I can't get my Registration page to create the Account, and i have no idea what's wrong.


http://imageshack.us/photo/my-images/97/capturecbs.jpg[^]
PHP
    ini_set('display_errors', true);
    error_reporting(E_ALL);

     $username = $_POST["RGusername"];
     $password = md5($_POST["RGpassword"]);

     if($username&&$password)
     {
        mysql_connect('localhost','root','asdfr');
        mysql_select_db("database") or die("Couldn't find database");
        
        $Query = mysql_query("SELECT * FROM account WHERE Username='$username' LIMIT 1");  
        $id = (mysql_insert_id() + 1);
        $rows = mysql_num_rows($Query);
        echo $rows ;
        if($rows == 0)
        {
          mysql_query("INSERT INTO `database`.`account' (User_ID, Username, Password)
          VALUES(($id), $username, $password)");

          echo $password;  ?><html> <br />  </html>           echo $rows;      ?><html> <br />  </html>           echo $username;  ?><html> <br />  </html>           echo $id;        ?><html> <br />  </html> 
          if(mysql_num_rows($Query) == 1)
          {
            // Successful account creation
            echo("Account created");
          }
          else
              echo("Account not created, problem hit");
        }
        else
            echo("Username already exists");
     }
     else
         echo("Please enter all feilds");
?>
Posted
Comments
Simon Bang Terkildsen 27-Aug-11 18:10pm    
If you don't supply more information you wont get an answer. So tell us what the symptoms are, do you get an error message? where in your code does it do something you do not expect?
Uday P.Singh 28-Aug-11 3:11am    
are you getting any error message, if yes then post it, so that we can help you better.

1 solution

Could you please provide detail error?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900