# Php sign up help!

**URL:** <https://forum.kirupa.com/t/php-sign-up-help/328238>\
**Category:** Uncategorized\
**Created:** [April 30, 2012, 1:31pm UTC](https://forum.kirupa.com/t/php-sign-up-help/328238 "2012-04-30T13:31:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raphaelle](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@raphaelle](https://forum.kirupa.com/u/raphaelle)\
**Post date:** [April 30, 2012, 1:31pm UTC](https://forum.kirupa.com/t/php-sign-up-help/328238/1 "2012-04-30T13:31:39Z")

</div>

hello good day to everone, anyway im a newbie on php, and im creating a website which requires sign up or registration before entering the site, anyway Im using MySQL for back-end(database). hope u can help me guys, thanks in advance… heres my code but it has an error " **Warning: Wrong parameter count for mysql\_connect() in C:\wamp\www\webtry\check\_signup.php on line 28  
Cannot connect to database**"

This is my code :

\<html\>

\<title\>

\</title\>

\<head\>  
\<link rel=“stylesheet” type=“text/css” href=“layout.css” /\>  
\<link rel=“shortcut icon” href=“clown.png” /\>

\</head\>

\<body\>

\<?php

$host= “localhost”;  
$username="";  
$password="";  
$age="";  
$fname="";  
$lname="";  
$id= “”;

$db\_name=“test”;  
$tbl\_name=“member”;

mysql\_connect("$host", “$username”, “$password”, “$fname”, “$lname”, $age) or die(“Cannot connect to database”);  
mysql\_select\_db("$db\_name") or die (“Cannot select DB!”);

$myfirstname=$\_POST[‘myfirstname’];  
$mylastname=$\_POST[‘mylastname’];

$myage= $\_POST[‘myage’];

$myusername=$\_POST[‘myusername’];  
$mypassword=$\_POST[‘mypassword’];

$check= "SELECT \* FROM $tbl\_name WHERE username= ‘$myusername’ and password= ‘$mypassword’ AND  
fname= ‘$myfirstname’ AND lname= ‘$mylastname’ AND age= $myage ";

$qry= mysql\_query($check) or die (“Could not match”);  
$num\_rows = mysql\_num\_rows($qry);

if($num\_rowns !=0)  
{  
echo “Sorry, the username $myusername is already taken.”;  
exit;  
}  
else  
{  
$insert = mysql\_query(“INSERT INTO $tble\_name VALUES(‘NULL’,’$myusername’, ‘$mypassword’, ‘$myfirstname’, ‘$mylastname’, ‘$myage’”)  
or die(“Could not insert data”);  
}

?\>

\</body\>

\</html\>
