Hi there,
Usually I'm able to solve problems by looking them up on Google and what not, but I cannot, for the life of me, figure out what is going on.
I have a table in my database (pre_users), which contains six columns (id, email, password_hash, group_id, registration_timestamp, and banned). All I want is the first four columns of this table. So, like usual, I do the following:
Now, I have never had this not work, and never had it do this. Instead of retrieving just the four items of data I need and putting them into the array (1, 741ca4f041c938a296d8f8f90bcad351, , 1), it returns the following: , , , , , 1, 741ca4f041c938a296d8f8f90bcad351, [email], 1. That is double the requested result (4 requested, 8 returned), and the double set being empty.
I've attempted to ignore this by using a combination of array_unique(), array_push() (as a second array, similar to this, needs to be tacked onto the end of this one. Also of note, this same occurrence happens with that array was well.), etc., but cannot get it to work. Any ideas or help will be VERY much appreciated. I'm about to throw my computer out the window.
Usually I'm able to solve problems by looking them up on Google and what not, but I cannot, for the life of me, figure out what is going on.
I have a table in my database (pre_users), which contains six columns (id, email, password_hash, group_id, registration_timestamp, and banned). All I want is the first four columns of this table. So, like usual, I do the following:
Code:
$sql1 = "SELECT id, email, password_hash, group_id FROM pre_users WHERE id=1";
$res1 = mysql_query($sql1);
$array1 = mysql_fetch_array($res1);
Now, I have never had this not work, and never had it do this. Instead of retrieving just the four items of data I need and putting them into the array (1, 741ca4f041c938a296d8f8f90bcad351, , 1), it returns the following: , , , , , 1, 741ca4f041c938a296d8f8f90bcad351, [email], 1. That is double the requested result (4 requested, 8 returned), and the double set being empty.
I've attempted to ignore this by using a combination of array_unique(), array_push() (as a second array, similar to this, needs to be tacked onto the end of this one. Also of note, this same occurrence happens with that array was well.), etc., but cannot get it to work. Any ideas or help will be VERY much appreciated. I'm about to throw my computer out the window.