1

Problem: sql = select address from mytable were name like 'T%' returns address ok except where the address is like 'Cr James & Dennis Street'. This value is returned truncated to 'Cr James'

My database is a mssql server. I use the PHP ODBC driver with the following connection string:

$db = odbc_pconnect("Driver={SQL Server Native Client 10.0};
Server=" . $SERVER . ";Database=". $Database. ";", $UID, $PWD);
low_rents
  • 4,481
  • 3
  • 27
  • 55
Bob
  • 11
  • 1

1 Answers1

-1

In mysql we can use mysqli_real_escape_string like:

mysql_query('SELECT * FROM table WHERE column like "%'.mysqli_real_escape_string("data & the base").'%"');

Read this post, perhaps it helps you:

mysql_real_escape_string alternative for SQL Server

Community
  • 1
  • 1
Javi
  • 506
  • 3
  • 15