p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   PHP Databases (http://p2p.wrox.com/forumdisplay.php?f=97)
-   -   How to creat an user account (http://p2p.wrox.com/showthread.php?t=57473)

prad_a May 4th, 2007 07:19 AM

How to creat an user account
 
Hi all,
I'm a novice in PHP. Here i have a problem. How can i create a new user account, by validating the existing ids presenting in the database.

  After checking for availability, If the user name already exists, options should be given to the user based on the first, middle and last name given bye the user itself..

Kindly someone help me,

Thanks in advance,
Prad.


cyber_kaley May 12th, 2007 03:25 AM

find unique is username in database

$username = $_POST['username'];
///////
$query_advertiseleft = "SELECT * FROM useraccount WHERE username = '$username'";
$Recordset1 = mysql_query($query_advertiseleft, $cms) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$total_Recordset1 = mysql_num_rows($Recordset1);

if($total_Recordset1 == 0){

echo'SORRY ALREDY HAVE FOR THAT USERNAME';


}else{
///inserte the NEW ACCOUNT HERE:///

$sqlInsert = "INSERT INTO useraccount (artistid,name,category)
VALUES('$row_artist[id_artist]','$row_artist[artis_name]')";
$artist = mysql_query($sqlInsert, $cms) or die(mysql_error());


}

its not complete code ok i just show the mysql
MySQL Where,
MySQL Insert
cyber_kaley20@yahoo.com


caley


All times are GMT -4. The time now is 10:06 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.