onion2k wrote:smashhell wrote:Is it impossible to assign one column from database to one array ?
One of PHP's greatest failings is that there's so much written for you that people expect
everything to be written for you. This is an example of something that you will have to write yourself. Rather than whining that you don't know how to do it, and saying it might be impossible, how about thinking about the problem for a few minutes and working out how to solve it?
This forum is here to
help. It is not here to provide software development for free. If you have a question about how to solve the problem then feel free to ask. If you just want someone to write the code for you, go somewhere else.
First of all, I am not the kind of person that ask someone for their codes. In fact, I don't even copy and paste my own codes.
Second, yeah of course I spent a ton of time trying to solve the problem.
I am a month new into PHP and I only came here to ask because I can't solve it.
Anyone, here is mine "tenth" attempt of trying to solve my problem.
Again, I just want someone to tell me whats wrong with my code.
Thank you.
Code: Select all
$query = "SELECT * FROM table ORDER BY id DESC";
$run = mysql_query($query,$connection);
$num = 0;
while($row = mysql_fetch_array($run)) {
$id[] = $row[$num]['id'];
$num++;
}
}
*That failed as well. It return the correct number of slots but no info inside, not even the id number. I seriously don't know how to solve this.
