I had array values as cause
Ex: $cause = $_REQUEST['cause'];
ie., $cause = 2,3,4
How to get that array value cause name from query
My table name is 'cp_cause'
How to get the 2,3,4 cause name from the above table.
My sample query model in thinkphp is
$cause_name = $GLOBALS['db']->getAll("select category from ".DB_PREFIX."category where id = '".$cause."'");
i want the name of labour, health, women
If I get it right: you get comma separated Ids and want to query this?
PHP:
The result should be a list, containing the matching rows. But we do not know, what your getAll-Method returns!
Example: if result is an array, you can iterate: