Monkuar Posted February 11, 2012 Share Posted February 11, 2012 $DB->query("SELECT g_title from ibf_groups where g_title NOT IN ('Validating','Guests') order by g_title"); while($group = $DB->fetch_row()){ $data[] = $group['g_title']; } echo $data[0]; var_dump($data); var dump 'TITLE' => string 'Validating' (length=10) 'ICON' => null 0 => string 'Admin' (length=5) 1 => string 'Donor' (length=5) 2 => string 'Loser' (length=5) 3 => string 'Members' (length=7) 4 => string 'Members+' (length= 5 => string 'Moderator' (length=9) 6 => string 'Senior Moderator' (length=16) how do I get rid of Validating? and ICON? Quote Link to comment https://forums.phpfreaks.com/topic/256879-code-is-spitting-out-some-retarded-title-array-rofl/ Share on other sites More sharing options...
spiderwell Posted February 11, 2012 Share Posted February 11, 2012 if its the first key array shift should do it Quote Link to comment https://forums.phpfreaks.com/topic/256879-code-is-spitting-out-some-retarded-title-array-rofl/#findComment-1316929 Share on other sites More sharing options...
trq Posted February 11, 2012 Share Posted February 11, 2012 You must be putting them into the $data array prior to this code. By the way, programming is an exact science. If anything goes wrong it is always human error. Quote Link to comment https://forums.phpfreaks.com/topic/256879-code-is-spitting-out-some-retarded-title-array-rofl/#findComment-1316930 Share on other sites More sharing options...
Monkuar Posted February 11, 2012 Author Share Posted February 11, 2012 You must be putting them into the $data array prior to this code. By the way, programming is an exact science. If anything goes wrong it is always human error. That's the nicest way to call me Retarded, (I Was asking for it in the title I guess? ) Lol okay here var_dump(array_shift($data)); returns back only 1 array string 'Validating' (length=10) I have g_icon as a field row in my ibf_groups Thorpe, but im not Calling it with my query, but it seems to be seen with the array? How if I am only selecting g_title? I checked any code above, i have nothing Quote Link to comment https://forums.phpfreaks.com/topic/256879-code-is-spitting-out-some-retarded-title-array-rofl/#findComment-1316932 Share on other sites More sharing options...
trq Posted February 11, 2012 Share Posted February 11, 2012 Lol okay here Code: [select] var_dump(array_shift($data)); returns back only 1 array Because array_shift returns the element it is shifting off. Still, You must be putting those values into $data prior to the code you posted. Try this: var_dump($data); $DB->query("SELECT g_title from ibf_groups where g_title NOT IN ('Validating','Guests') order by g_title"); while ($group = $DB->fetch_row()) { $data[] = $group['g_title']; } var_dump($data); Quote Link to comment https://forums.phpfreaks.com/topic/256879-code-is-spitting-out-some-retarded-title-array-rofl/#findComment-1316933 Share on other sites More sharing options...
Monkuar Posted February 11, 2012 Author Share Posted February 11, 2012 Okay, I looked at more Code above I guess some other code was using my variable $group... maybe next time I should use better/unique variable names... Thanks for the help thorpe, lol Saved the day again! Topic SOLVED!! Quote Link to comment https://forums.phpfreaks.com/topic/256879-code-is-spitting-out-some-retarded-title-array-rofl/#findComment-1316935 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.