I have a conditional string like this:
echo $cnd = "'use_funds'=>'no'";
And my $data array is :
$data = array(
$cnd,
'quantity' => $_POST['qty_' . $q],
'veg_name' => $_POST['veg_name_' . $q],
'rate' => $_POST['rate_' . $q],
'ws_price' => $_POST['ws_price_' . $q],
'ret_price' => $_POST['ret_price_' . $q],
'mop' => $_POST['mop_' . $q],
'ret_margin' => $_POST['ret_margin_' . $q]
);
The above echo $cnd shows 'use_funds'=>'no', but the var_dump($data) shows array
0 => string ''use_funds'=>'no'' (length=17) . And since its a string my data is not inserting in my table. How can I make the $cnd to a associative array element instead of string?
$cndcontain PHP code? Wouldn't it make more sense to have something like$use_funds = 'no'?