Jump to content

Registration problems - missing column and not signed in.


Namtip

Recommended Posts

I'm running XAMPP 1.7.3, so that means I have Apache 2.2.14 (IPv6 enabled), MySQL 5.1.41 + PBXT engine, PHP 5.3.1 on a windows OS.

 

My problem: Warning: extract() expects parameter 1 to be array, boolean given in C:\x\xampp\htdocs\profile_update.php on line 90. When my page tries to upload some user profile variables. It also incorrectly thinks its not signed in...

 

What my half wit mind thinks at 4:47 in the morning: I've checked phpmyadmin and the column for the profile hasn't been uploaded! Does an end user have to enter info via forms for a column to be entered into the db or can I get php to make some empty columns through the registration form like I've done with the following script??

 

        $query = 'INSERT INTO site_user 
                (user_id, username, password)
           VALUES 
               (NULL, "' . mysql_real_escape_string($username, $db) . '", ' . 
                'PASSWORD("' . mysql_real_escape_string($password, $db) . '"))';
        $result = mysql_query($query, $db) or die(mysql_error());

        $user_id = mysql_insert_id($db);

        $query = 'INSERT INTO site_user_info 
                (user_id, first_name, last_name, email, address, city, county)
           VALUES 
               (' . $user_id . ', ' .
                '"' . mysql_real_escape_string($first_name, $db)  . '", ' .
                '"' . mysql_real_escape_string($last_name, $db)  . '", ' .
                '"' . mysql_real_escape_string($email, $db)  . '", ' .
                '"' . mysql_real_escape_string($address, $db)  . '", ' .
                '"' . mysql_real_escape_string($city, $db)  . '", ' .
                '"' . mysql_real_escape_string($county, $db)  . '")';
        $result = mysql_query($query, $db) or die(mysql_error());

	$user_id = mysql_insert_id($db);

	$query = 'INSERT INTO site_user_profile  
                (user_id, about_me, employment, education, contact)
           VALUES 
               (' . $user_id . ', ' .
                '"' . mysql_real_escape_string($about_me, $db)  . '", ' .
                '"' . mysql_real_escape_string($employment, $db)  . '", ' .
                '"' . mysql_real_escape_string($education, $db)  . '", ' .
                '"' . mysql_real_escape_string($contact, $db)  . '", ' .
        $result = mysql_query($query, $db) or die(mysql_error());

If you need any more information I'd be happy to give you more but I'm gonna hit the sack for a few hours. I'll link you the code for the sign in error if needed when I'm awake. Thanks guys, you're super troopers, all of you. :rtfm:

Link to comment
Share on other sites

How would I find the code which causes the error? I'm sorry I'm a newbie at coding. I'm not so concerned about the lines where the error message occurs because I believe the root of the issue lies in the way the registration scripts have entered the data into mysql.

 

I now have 1 entry in the site_user table. 2 duplicate entries for site_user_info table and 0 entries for site_user_profile.

 

I need 1 entry in all of the tables. I have not given the user a form to enter data into site_user_profile(I was hoping to give them an update form a couple of pages later). Is that possible? I'm sorry If i infuriate you with my stupidity.

 

 

 

Link to comment
Share on other sites

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.