简体   繁体   中英

php array element size is limited

I am getting rows from database but one column name of table is too large ie "Booking_Physical_Location_Id"

I am getting column name except last letter 'd'.

This is my code snippet:

$Con = $this->OpenMSSqlConnection($this->DBObject);

$rs = odbc_exec($Con, $q);

$Result = '';
while ($row = odbc_fetch_array($rs))
{
    $Result[] = $row;  
}
unset($rs);    
return $Result;

Here's the var_dump result of $row array

 array(36) {
  'Booking_Id' =>
  string(15) "103090000000242"
  'Identity_Column' =>
  string(3) "506"
  'Article_Tracking_No' =>
  string(13) "EZ454576987PK"
  'Reference_Id' =>
  NULL
  'Client_Id' =>
  string(15) "103090000000074"
  'Service_Id' =>
  string(1) "2"
  'Delivery_Area_Id' =>
  string(3) "319"
  'To_Location_Id' =>
  string(1) "1"
  'From_Location_Id' =>
  string(3) "308"
  'Booking_Physical_Location_Id' =>
  string(1) "9"
  'Destination_Physical_Location_I' =>
  string(1) "1"
  'Reason_Id' =>
  NULL
  'Total_Charges' =>
  string(1) "0"
  'Article_Status_Id' =>
  string(1) "1"
  'Booking_Date' =>
  string(23) "2015-03-18 10:02:01.803"
  'Booking_Mode_Id' =>
  string(1) "1"
  'Entry_Location_Id' =>
  string(3) "309"
  'Delivery_Date' =>
  NULL
  'Delivery_By' =>
  NULL
  'Delivery_Location_Id' =>
  NULL
  'Delivery_Mode_Id' =>
  NULL
  'Receipient_Title' =>
  string(7) "FGHJGFD"
  'Receipient_Address' =>
  string(5) "GHJHG"
  'Receipient_Contact_No' =>
  string(3) "554"
  'Receipient_Mobile_No' =>
  NULL
  'Article_Wamount' =>
  string(4) "2142"
  'Booking_By' =>
  string(3) "116"
  'Service_Charges_Location_Detail' =>
  NULL
  'Transit_State_Id' =>
  string(1) "2"
  'Received_By' =>
  NULL
  'Shift_Id' =>
  string(1) "1"
  'Commision' =>
  NULL
  'GST' =>
  NULL
  'Other_Charges' =>
  NULL
  'Invoice_Id' =>
  NULL
  'msrepl_tran_version' =>
  string(36) "00000000-0000-0000-0000-000000000000"
}

There is no key's length limit in php, except of the script's memory limit
You have 2 different fields in your table 'Booking_Physical_Location_Id' and 'Booking_Physical_Location_I'

You can verify this using DESC TABLE_NAME

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM