Go easy on me since I’m new to PHP 😉
My development stack is Windows 7 with XAMP, My live server is a turnkey LAMP stack.
I’m using ADODB to connect to MSSQL and append all the results into a string with the code below:
$sql = "SELECT Field1 FROM tb_Table";
$rs = $db->Execute($sql);
if (!$rs) {
print $db->ErrorMsg();
} else {
$arr = $rs->GetRows();
$rows = '';
//Loop through parent array (rows)
for ($i=0;$i<=(count($arr)-1);$i++) {
$rows .= " ".$arr[$i][0]." ";
}
print strlen($rows)
The string length on my local machine is 195,057 on the Server it is 136,858
I have checked that the same number of rows has been returned from the database, but I don’t understand why the length of the string should differ between environments.
Any pointers would be very much appreciated
Ok, sussed it. The issue wasn’t the code it was the provider, the provider on the Linux box only returns a maximum length of 255 from the field.
The windows provider returns the full length of the field.
Thanks everyone for looking 🙂