Jump to content

[SOLVED] Row updating from another table?


Recommended Posts

You could just do 2 insert queries?

http://dev.mysql.com/doc/refman/5.0/en/insert.html

 

the syntax for an insert query also suggest you can insert into 2 tables so long as you properly call each field to be inserted by not being too ambiguous

I've tried this and I couldn't get it to work so I was seeing if I could just do this.  Cause the forum software I'm using is smf and the registration script is very complicated through different php files.  I'll try and mess with it some more though.

 

The code I was trying to use:

 

<?php
$name = $_POST['x'];
$user = $_POST['x'];
$pass = $_POST['x'];
$pass_c = $_POST['x'];
$email = $_POST['xl'];


// Insert user into the database
   $query = 'INSERT INTO users (userName, userUser, userPass, userEmail) VALUES ("' . $name . '", "' . $user . '", "' . md5($pass) . '", "' . $email . '")';
   mysql_query($query, $link);
?>

if the query don't work and u don't know why error check it

<?php
$name = $_POST['x'];
$user = $_POST['x'];
$pass = $_POST['x'];
$pass_c = $_POST['x'];
$email = $_POST['xl'];


// Insert user into the database
   $query = 'INSERT INTO users (userName, userUser, userPass, userEmail) VALUES ("' . $name . '", "' . $user . '", "' . md5($pass) . '", "' . $email . '")';
   mysql_query($query, $link) or die(mysql_error()."<br /><br />\n\n".$query);
?>

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.