title: php mysql query not executing correctly
body: <p>I have a weird problem with my sql script.</p>
  
  <p>I have a string </p>
  
  <pre><code>$query = "INSERT into sms_replyid (eventid, bus_id, cell_num, sms_message) 
            VALUES ('93361357', '2162', '27761144734', 'Hoekom');";
  </code></pre>
  
  <p>But when I execute that string it inserts it to the table but eventid stays 0, if I run that exact command in cmd it works perfectly?</p>
  
  <p>Any ideas why this is not inserting all the values?</p>
  
  <p>Edit Full code</p>
  
  <pre><code>&lt;?php session_start();
  
  $link = mysql_connect("localhost", "username", "password"); //removed u and p for posting
  
  if (!$link)
  
      die("Couldn't connect to MySQL");
  
  mysql_select_db("db", $link) //removed db name for posting
  
  or die ("Couldn't open smss:" . mysql_error());
  $id = $_SESSION['id'];
  
  $message = $_REQUEST['promo_message'];
  $timeToSend = $_REQUEST['timeToSend'];
  $dateToSend = $_REQUEST['dateToSend'];
  
  
  
  
  
      if(isset($_REQUEST['input_cell']))
      {
          $receiver = $_REQUEST['input_cell'];
          if($receiver != '')
          {
              $response_string = sendSMSPortalSchedule($message, $receiver, $sender_id, $dateToSend, $timeToSend);
              $response_string = str_replace ( "True" , "", $response_string );
  //This does not work right, all gets added perfectly yet eventid stays 0 enven while all the others get the right values
          $query1 = "INSERT into sms_replyid (eventid, bus_id, cell_num, sms_message) VALUES ('$response_string', '$id', '$receiver', '$message');";
  
          mysql_query($query1);
          echo mysql_error();
          }
      }
      if(isset($_REQUEST['single_cell']))
      {
          $receiver = $_REQUEST['single_cell'];
          if($receiver != 'none')
          {
          $response_string = sendSMSPortalSchedule($message, $receiver, $sender_id, $dateToSend, $timeToSend);
          $response_string = str_replace ( "True" , "", $response_string );
          $query2 = "INSERT into sms_replyid (eventid, bus_id, cell_num, sms_message) VALUES ('$response_string', '$id', '$receiver', '$message');";
  //This does not work right, all gets added perfectly yet eventid stays 0 enven while all the others get the right values
          mysql_query($query2);
          echo mysql_error();
  
          }
  
      }
  
      if(isset($_REQUEST['sento_group']))
      {
              $array = $_REQUEST['sento_group'];
          foreach($array as $receiver)
          {
              if($receiver != 'none')
              {
                  $query = 'SELECT cell_number FROM cell_groups WHERE group_id ="'.$receiver.'"';
                  $result2 = mysql_query($query) or die('Fail');
  
                  while($row=mysql_fetch_array($result2))
                  {
                  $response_string = sendSMSPortalSchedule($message, $row['cell_number'], $sender_id, $dateToSend, $timeToSend);
                  $response_string = str_replace ( "True" , "", $response_string );
                  $to = $row['cell_number'];
                  $query3 = "INSERT into sms_replyid (eventid, bus_id, cell_num, sms_message) VALUES ('$response_string', '$id', '$to', '$message');";
  //This does not work right, all gets added perfectly yet eventid stays 0 enven while all the others get the right values
                          mysql_query($query3);
                  echo mysql_error();
              }
              }
          }
      }
  }
  </code></pre>
  
  <p>This is the table</p>
  
  <pre><code>id = INT
  eventid = BIGINT(20)
  bus_id = INT
  cell_num = VARCHAR
  sms_message = VARCHAR
  </code></pre>