I'm new and need a little help. I've been reading php.net but still kind of lost. This is what I want to do..I have two database (maindb and seconddb). I want to transfer the username from maindb to seconddb. How would I do that? I understand it's just selecting the maindb and insert it in the seconddb. I just don't understand how to write the syntax. Do I have to do a mysql connect also? What goes into: mysql_query("INSERT INTO mytable (product) values ('kossu')");?
I'm trying to do a phpbb integrate with my site. If my site's password is not encrypted, will that cause any issues transfering it to phpbb's password since phpbb is encrypted.
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('maindb');
mysql_query("INSERT INTO mytable (product) values ('kossu')");
printf("Last inserted record has id %d\n", mysql_insert_id());
?>