This is my simple query and even it is not executing ,
my $total is 3;
$pnc = array();
$pnc[] = ('318','259','789');
$total = count($pnc);
for($p=0;$p<$total;$p++)
{
echo $query = "select `id` from `patents` where `number`=?";
$stmt = $mysqli->prepare($query) or $mysqli->error ;
$stmt->bind_param("s",$pnc[$p]);
$stmt->execute();
$stmt->bind_result($id);
$stmt->fetch();
echo $id;
}
When i am echoing query i am getting
select `id` from `patents` where `number`='318'
and when i am running this query in phpmyadmin its getting ‘id’ value , but here it is unable to get the id,
Is this the problem occurs due to Undefined offsetbind_param("s",$pnc[$p]); even i am getting value of each element of the array.
Please give a solution for this
thanks.
Change–TO
Error in your code –> Error