Hello all,
Does file_get_contents maintain line breaks? I thought it did but I have tried this:
if($conn){
$tsql = file_get_contents('scripts/CreateTables/SLR05_MATCH_CREATETABLES.sql');
$row = sqlsrv_query($conn, $tsql);
print_r(sqlsrv_errors());
}
The errors I get is that SQL Server complains that there is incorrect syntax. I get the same errors when I run the SQL Script without any line breaks, which suggests file_get_contents removes them?
When I run the script normally (open the file in SQL Server Management Studio) and execute it, it works perfectly.
So is there something that I can use that maintains line breaks etc? Or is there another problem here in using queries from a file with the SQL Server PHP Driver from Microsoft?
Thanks all for any help