Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
% operator in php
Message
De
24/11/2016 15:18:08
 
 
À
Tous
Information générale
Forum:
PHP
Catégorie:
Autre
Titre:
% operator in php
Divers
Thread ID:
01643927
Message ID:
01643927
Vues:
35
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
Répondre
Fil
Voir

Click here to load this message in the networking platform