![]() |
[PHP/MySQL] Pulling Multiple Rows *Solved*
Solved. I'm an idiot, I forgot the most basic thing. :)
I haven't touched PHP in a while, and forgot most of the basics, which I'm going over by making small scripts at the moment. However, I'm stuck. I have a MySQL database with 2 rows, each having 3 fields. What I'm trying to do, is get a resulting array from a query which will hold information from both rows, which are in the same field. --------------------- | id | name | age | --------------------- | 1 | Sally | 14 | --------------------- | 2 | Mark | 13 | --------------------- What I need, is to get for example, "Sally" and "Mark" in the same array so from there I can pull them apart and manipulate them for my objective. How can I do this? |
This would do the trick:
PHP Code:
PHP Code:
|
Lol, Andrew :) Glad you sorted it. It's all part of the learning process!
|
Well, I knew about the while, but the wierd thing was when I dumped the mysql array I get from mysql_fetch_array(), the second row values didn't show up, so I assumed it didn't work (until I tried just doing the while statement).
|
| All times are GMT. The time now is 01:30 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0