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

[eluser]Tim Brownlaw[/eluser]
Ok I did a search on your Inserts and yes, that syntax is apparently correct! So my apologies on that issue.

I'll stick to one point each reply as you didn't take the time to answer the other questions.

What do you get when you change...
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');
To
Code:
$sql = "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
       ";
    var_dump($sql); // Let's see what the actual SQL generated is!
//$this->db->query($sql); // Perform the Insert



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