The forums have permanently moved to This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

Results 1 to 2 of 2

Thread: Php sign up help !

  1. #1

    Php sign up help !

    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 :




    <link rel="stylesheet" type="text/css" href="layout.css" />
    <link rel="shortcut icon" href="clown.png" />




    $host= "localhost";
    $id= "";


    mysql_connect("$host", "$username", "$password", "$fname", "$lname", $age) or die("Cannot connect to database");
    mysql_select_db("$db_name") or die ("Cannot select DB!");


    $myage= $_POST['myage'];


    $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.";
    $insert = mysql_query("INSERT INTO $tble_name VALUES('NULL','$myusername', '$mypassword', '$myfirstname', '$mylastname', '$myage'")
    or die("Could not insert data");



    Last edited by raphaelle; April 30th, 2012 at 09:35 AM. Reason: Forgot my codes.

  2. #2
    Hi, Its simple... the error says

    "Warning: Wrong parameter count for mysql_connect() "

    what that means is that you have the wrong number of paramers in the function mysql_connect().
    it only requires

    mysql_connect("host", "username", "password")

    So u need to remove your extra vars such as "$fname", "$lname", $age)"... and then try it...


    Hope this helps

    Click here to read the signature guidelines for the forums.
    Reason: please see footer dimension rules

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Home About Meet the Moderators Advertise

 Link to Us


Copyright 1999 - 2012