I have a situation where a dynamic query is being generated that could select anywhere from 1 to over 300 different columns across multiple tables. It currently works fine just doing a query, however the issue I'm running into in using a prepared statement is that I do not know how to handle the fact that I don't know how many columns I will be asking for each time and therefor don't know how to process the results. The reason I believe a bind statement will help is because once this query is run once, it will most likely (though not always) be run again with the exact same parameters.
Şu anda böyle bir şey var:
$rows = array();
$this->statement = $this->db->prepare($query);
$this->statement->bind_param('i',$id);
$this->statement->execute();
$this->statement->bind_result($result);
while($this->statement->fetch())
{
$rows[] = $result;
}
Ben bunu istiyorum bu işe yaramazsa biliyorum, benim soru nasıl sorgunun geri veri almak yapmaktır. Standart bir mysqli sorgu gibi, geri sütun adıyla bir ilişkisel dizi sütunları getirmek mümkün mü?