php - Codeigniter & Datamapper: Retrive all the ID's from ID column and attach to array -
I'm having trouble collecting all the IDs in the column. The code above is only getting an ID, At least this goes on the array but I want to take them all. That returns: SELECT and array ([ID] => 43), but 10 others Am I wrong Am doing $ getArticlesId = new Article_model (); $ GetArticlesId-> Select ('id'); $ GetArticlesId-> (Get); $ Anarray = $ getArticlesId-> to_array ('id');
article .
id FROM (
article )
to_array () generates an array with your specified fields < Code> all_to_array () generates several arrays with your assigned ID field.
$ anarray [0] ['id'] Your first ID should be hopefully you want it.
Comments
Post a Comment