ive looked around here and i see similar questions is already answered but i still cant figure this out (as always, im a total noob and need decent explanations)
I have a users.db (userId, mmbrship, mmbrship_date) a few more values but these are the ones i need to update.
Then i have a payments.db ( id, txnid, payment_amount, payment_status, itemid, createdtime )
In my functions.php i have this code:
function updatePayments($data){
global $link;
if(is_array($data)){
$sql = mysql_query("INSERT INTO `payments` (txnid, payment_amount, payment_status, itemid, createdtime) VALUES (
'".$data['txn_id']."' ,
'".$data['payment_amount']."' ,
'".$data['payment_status']."' ,
'".$data['item_number']."' ,
'".date("Y-m-d H:i:s")."'
)", $link);
return mysql_insert_id($link);
}
}
I need the values 'itemid' and 'createdtime' from payments.db to be inserted into users.db in 'mmbrship', 'mmbrship_date'
And i need the 'userId' from users.db to be inserted to payments.db (to connect the user to its purchase)
This is so i can get info from users.db if a member have paid their membership and as it is now the payments.db insert its own id. So i think if i can just connect these two tables with the userId i might be a step in the right direction...
? Please help :)