MySQL and PHP are the tools for this job.
I have a project that I am trying to complete. It is just something that I am trying to write that will make my life/work easier. The funny thing is that I could have done everything the long way and completed my task by now. I have a database of hosting customers that will grow and I'd like to give these customers access to a forum I host. If I am able to construct this script, I will setup a cron job to run it automatically.
I need to query a database and extract some values like (username, password, join date, email address, etc) from two tables in a single database. I'd then like to insert those values into a table in a different database.
The only hint I have been given is listed below. I've been playing arround with information from php.net and I am as lost as ever. I've even tried Janebuilder, but, the documentation is sparse. Can someone do my work for me? Or at least help me fill in the blanks.
I am able to connect/disconnect to the appropriate databases with no problems.
--
$hosting_info = mysql_query("SELECT * FROM customers WHERE id='1' LIMIT 1");
$hosting_row = mysql_fetch_array($hosting_info);
$hosting_username = $hosting_row["username_col"];
$hosting_password = $hosting_row["password_col"];
$hosting_email = $hosting_row["email_col"];
then, close that connection to the mysql database then open a connection to the forum database.
$forum_info = mysql_query("INSERT INTO members_table( `user_col` , `pass_col` , `email_col` ) VALUES($hosting_username, $hosting_password, $hosting_email)");
ANY and ALL help is appreciated.
SPN
CCNA student
I have a project that I am trying to complete. It is just something that I am trying to write that will make my life/work easier. The funny thing is that I could have done everything the long way and completed my task by now. I have a database of hosting customers that will grow and I'd like to give these customers access to a forum I host. If I am able to construct this script, I will setup a cron job to run it automatically.
I need to query a database and extract some values like (username, password, join date, email address, etc) from two tables in a single database. I'd then like to insert those values into a table in a different database.
The only hint I have been given is listed below. I've been playing arround with information from php.net and I am as lost as ever. I've even tried Janebuilder, but, the documentation is sparse. Can someone do my work for me? Or at least help me fill in the blanks.
I am able to connect/disconnect to the appropriate databases with no problems.
--
$hosting_info = mysql_query("SELECT * FROM customers WHERE id='1' LIMIT 1");
$hosting_row = mysql_fetch_array($hosting_info);
$hosting_username = $hosting_row["username_col"];
$hosting_password = $hosting_row["password_col"];
$hosting_email = $hosting_row["email_col"];
then, close that connection to the mysql database then open a connection to the forum database.
$forum_info = mysql_query("INSERT INTO members_table( `user_col` , `pass_col` , `email_col` ) VALUES($hosting_username, $hosting_password, $hosting_email)");
ANY and ALL help is appreciated.
SPN
CCNA student