php mysql查询没有正确执行

I have a weird problem with my sql script.

I have a string

$query = "INSERT into sms_replyid (eventid, bus_id, cell_num, sms_message) 
          VALUES ('93361357', '2162', '27761144734', 'Hoekom');";

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?

Any ideas why this is not inserting all the values?

Edit Full code

<?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();
            }
            }
        }
    }
}

This is the table

id = INT
eventid = BIGINT(20)
bus_id = INT
cell_num = VARCHAR
sms_message = VARCHAR

The SQL command itself is correct. The problem must be elsewhere.

Firstly, are you sure that the values of your parameters are correct? Try outputting the query after variable interpolation to see if it is correct:

$query1 = "INSERT into sms_replyid (eventid, bus_id, cell_num, sms_message) VALUES ('$response_string', '$id', '$receiver', '$message')";
echo $query1;

Seondly I notice that in you have INSERTs in multiple places. Make sure all of them work as expected. Remember that the one you think is executing may be different from the one that is actually executing.

I found the problem, the service I was using got changed to return XML where it usually just returned an integer, this caused me to try and insert XML into my BIGINT field, which is not possible. So in the end the problem was caused by an updated service that didn't notify clients about changes.