Query problem

Sir I am using this line of code

$str = 'date='.date_format($res['date'], 'Y-m-d').' and vou_no='. $res['vou_no'];
echo $str

it shows
date=2017-04-20 and vou_no=4

But I want this result
date=‘2017-04-20’ and vou_no=4

Comma with date

So how to modify this string to get desired result

$str = 'date='.date_format($res['date'], 'Y-m-d').' and vou_no='. $res['vou_no'];

Please help

You should make it this way

$str = 'date=? and vou_no=?';
$parameters[] = date_format($res['date'], 'Y-m-d');
$parameters[] = $res['vou_no'];

then prepare your query and then execute it.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.