[eluser]Tim Brownlaw[/eluser]
Code:
/**
Insert Into Outgoing Table
*/
$this->db->query('INSERT INTO outgoing_sms (dest_msisdn,text_message,sender_name,service_id)
SELECT receiver,"'.$new_message.'","'.$das_sender_name.'", "'.$das_service_id.'" FROM send_q');
/**
Insert Into Logs Table
*/
$this->db->query('INSERT INTO all_sent_messages (the_receiver_name,the_receiver_number,the_message,the_status,the_user_id,the_timestamp)
SELECT distinct sender,receiver,"'.$new_message.'","sent", "'.$current_id.'",now() FROM send_q');
Well here's the thing... Can you tell me that these two insert statements actually work?
I don't know how you can tell that your $new_message is not working!
What is the SQL generated in both cases? Does it look right?
Can you take those generated SQL Statements and use them in say phpmyadmin and test them out?
You seriously need to read up on how to perform inserts and the like.