Jump to content

Fatal error: No database selected in D:\Hosting\4688039\html\login5\regform1.php


Recommended Posts

<?php


    mysql_connect("cndlogin.********.com","cnd****","1");
    mysql_select_db('users');
    
    $uname = $_POST['uname'];
    $pw = $_POST['pw'];
    $vpw = $_POST['vpw'];
    $email = $_POST['email'];
    
$sql = "SELECT COUNT(*) FROM UserTable WHERE uname= '" . $_POST['uname'] . "'";
$result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR);
if($result){
    if(mysql_result($result,0) == 0){
         //username not taken
    }else{
        //username taken
    }
}else{
    //problem with query
}


?>

 

This is my registration code that im trying to make... i'm trying to validate username make sure its not taken. but i keep getting this error...

 

Fatal error: No database selected in D:\Hosting\4688039\html\login5\regform1.php on line 13

 

did i mess up on the sql side???.. and can someone help me make a code to verify that someone enterd an email adress....

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.