Jump to content

Code is spitting out some retarded TITLE Array? Rofl


Recommended Posts

 $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?

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

 

 

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);

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!!

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.