hi all. in my registration form, i want to insert informations into two different tables. these two tables are in the same databases. first one's name is tb_users, second one's name is wp_users.
i think this part is about inserting ;
$sqlz = "SELECT * FROM tb_users WHERE username='$referer'";
$resultz = mysql_query($sqlz);
$myrowz = mysql_fetch_array($resultz);
$numero=$myrowz["referals"];
$sqlex = "UPDATE tb_users SET referals='$numero'+1 WHERE username='$referer'";
$resultex = mysql_query($sqlex);
}
}
// Si todo parece correcto procedemos con la inserccion
$joindate=time();
$query = "INSERT INTO tb_users (username, password, ip, email, pemail, referer, country, joindate, money,visits) VALUES('$username','$password','$laip','$email','$pemail','$referer','$country','$joindate', '0', '0')";
mysql_query($query) or die(mysql_error());
echo "registered as <strong><b>$username</b></strong>";
now here, it inserts '$username','$password' values into tb_users->username, password
and i want to insert these '$username','$password' into wp_users->user_login,user_pass too. my aim is to let visitors register for one site and have account in two other sites. i have changed this section
PHP Kodu:
$query = "INSERT INTO tb_users (username, password, ip, email, pemail, referer, country, joindate, money,visits) VALUES('$username','$password','$laip','$email','$pemail','$referer','$country','$joindate', '0', '0')";
mysql_query($query) or die(mysql_error());
with this one
PHP Kodu:
$query = "INSERT INTO tb_users (username, password, ip, email, pemail, referer, country, joindate, money,visits) VALUES('$username','$password','$laip','$email','$pemail','$referer','$country','$joindate', '0', '0')";
$query = "INSERT INTO wp_users (user_login, user_pass) VALUES('$username','$password')";
mysql_query($query) or die(mysql_error());
but it still gave errors. i am not an experienced mysql man :) so it might be very easy for you to solve. i am thanking in advance to whom will help me with this. have a great day...
[edited by: jatar_k at 10:23 pm (utc) on Feb 10, 2010]
[edit reason] no urls thanks [/edit]