Topic: Insert user_id in other database

Hi, i would like to take user_id from forums database and insert this data in other database. I have the folow code:

include ('./../admin/conexion.php'); <-- Here i connect whit my database

define ('PUN_ROOT', './../foro/'); // <--here whit forum's DB
include PUN_ROOT.'include/common.php';   

$usuario= $pun_user['id'];  <-- i define user id

if(!$anadir=mysql_query("INSERT INTO wiki (fecha_insertado,u_fecha_modificacion,titulo,articulo,id_autor) values (CURDATE(),CURDATE(),'$titulo','$texto','$usuario')"))  <-- and here y try insert

This code generate an error:

Table 'foros_anait.wiki' doesn't exist

wiki is my DB and foros_anait y the forum's DB

Re: Insert user_id in other database

Well, that's clear enough, no? >=/

Re: Insert user_id in other database

I don't understand you
Yes, the table 'foros_anait.wiki'  doesn't exist, because are different tables!

In my sql sentence i only want insert in wiki table, but one date is stract by foros_anait (PunBB Forums) i don't understand why try insert in 'foros_anait.wiki'  instead of wiki.id_autor

Re: Insert user_id in other database

Ah, I see now. Well, you have to select another DB when doing this. But don't forget to switch back to your forum DB or everything will be messed up.

Re: Insert user_id in other database

ok, but, who can i do?

... sorry but i understand you mor or less, i suppouse by bad translation as for me

Re: Insert user_id in other database

Ohhh ok ok, I have already solved it, thank for all!!!