Welcome Guest, Not a member yet? Register   Sign In
str_replace does not work inside query
#2

[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.



Messages In This Thread
str_replace does not work inside query - by El Forum - 09-11-2014, 11:55 PM
str_replace does not work inside query - by El Forum - 09-12-2014, 02:02 AM
str_replace does not work inside query - by El Forum - 09-12-2014, 02:08 AM
str_replace does not work inside query - by El Forum - 09-12-2014, 04:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB