Hi Olunkwa Ikechukwu!

Try it now!

//////////////////////////////////////////////
<?php

$username = "Sukalyan";
$email = "[EMAIL PROTECTED]";
$password = "www123";

/*
................rest of the pert you should add........................
$first = "Sukalyan";
$family=$_POST ['family'];
$gender=$_POST ['gender'];
$birth=$_POST ['birth'];
$address=$_POST ['address'];
$city=$_POST ['city'];
$state=$_POST ['state'];
$country=$_POST ['country'];
$phone=$_POST ['phone'];
*/

include ("../db_connect.php");

      //check if the username is taken
   $check = "SELECT id from registration WHERE username = '$username'";

            $qry = mysql_query ($check);

            $num_rows = mysql_num_rows ($qry);
if ($num_rows >0)
      {
            echo "Sorry, The Username $username is already taken.<br>";
            echo "<a href="" Again</a>";
            exit;
      } else {
      //insert data
$query="INSERT INTO registration VALUES ('','$username', '$email', '$password')";
$result_insert = mysql_query($query);

}
mysql_close();
echo "We will contact you with Your Registration Information and Login Page";
?>



/////////////////////////////////////////////////'
                                                 Thanks,
                                               Sukalyan Banga










On Wed, 26 Apr 2006 Olunkwa Ikechukwu wrote :
>Hello All,
>First thanks to you all that took time to help me out
>with the script earlier, i did some changes on the
>script , but the script doesnt put any data in the
>table.
>Any ideas,
>Here's the new script
>================
><?
>$username=$_POST ['username'];
>$email=$_POST ['email'];
>$password=$_POST ['password'];
>$first=$_POST ['first'];
>$family=$_POST ['family'];
>$gender=$_POST ['gender'];
>$birth=$_POST ['birth'];
>$address=$_POST ['address'];
>$city=$_POST ['city'];
>$state=$_POST ['state'];
>$country=$_POST ['country'];
>$phone=$_POST ['phone'];
>include ("db_connect.php");
>      //check if the username is taken
>            $check = "SELECT id from registration WHERE username
>= '".$POST ['username']."';";
>            $qry = mysql_query ($check) or die ("Could not match
>data because" .mysql_error() );
>            $num_rows = mysql_num_rows ($qry);
>            if ($num_rows !=0)
>      {
>            echo "Sorry, The Username $username is already
>taken.<br>";
>            echo "<a href="" Again</a>";
>exit;
>      }else{
>      //insert data
>            $query="INSERT INTO registration VALUES (',
>'$username','$email', '$password','$first',
>'$family','$gender', '$birth', '$address', '$city',
>'$state', '$country','$phone')";
>            mysql_query($query);
>            }
>            mysql_close();
>            echo "We will contact you with Your Registration
>Information and Login Page";
>?>
>I am a Sun, impatiently waiting for dawn.
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
>Community email addresses:
>  Post message: [email protected]
>  Subscribe:    [EMAIL PROTECTED]
>  Unsubscribe:  [EMAIL PROTECTED]
>  List owner:   [EMAIL PROTECTED]
>Shortcut URL to this page:
>
>http://groups.yahoo.com/group/php-list
>SPONSORED LINKS
>Php mysql
>Job postings
>YAHOO! GROUPS LINKS
> Visit your group "
>php-list
>" on the web.
>
> To unsubscribe from this group, send an email to:
>
>[EMAIL PROTECTED]
>
> Your use of Yahoo! Groups is subject to the
>Yahoo! Terms of Service
>.


[Non-text portions of this message have been removed]





Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list




YAHOO! GROUPS LINKS




Reply via email to