Jump to content

Code is spitting out some retarded TITLE Array? Rofl


Monkuar

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.