Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
% operator in php
Message
From
24/11/2016 15:18:08
 
 
To
All
General information
Forum:
PHP
Category:
Other
Title:
% operator in php
Miscellaneous
Thread ID:
01643927
Message ID:
01643927
Views:
34
Sir I am using these codes with sqlserver
declare @f_date1 as date='2016-11-01'
 declare @groups as varchar(4)='1401'
 SELECT acc_code,open_dr as dr_amount,open_cr as cr_amount  from master   where acc_code like @groups+'%'
it work fine, but when i use with php query like this
$groups='1401';
 $t_date1=date('Y-m-d');
 SELECT acc_code,dr_amount,cr_amount from vouchers
 where  date <= '".$t_date1 ."' and LEN(acc_code)>4
 and acc_code like '".$groups."+%
then it says:

Warning: sqlsrv_errors() expects parameter 1 to be long, resource given in C:\wamp\www\atsql17_php\book_blance.php on line 370

the question is how to modify this line in php
like '".$groups."+%


Please help
Reply
Map
View

Click here to load this message in the networking platform