Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

array help please

Status
Not open for further replies.

Jamfool

IS-IT--Management
Joined
Apr 10, 2003
Messages
484
Location
GB
I have a query that returns me a undetermined number of rows with a set column width of 6.

All I want to do is too put the values from my query into an array so i can access the individual columns in each row. 2d array? Can some1 please help me with this. thanks

1,col1,col2,col3,col4,col5,col6
2,col1,col2,col3,col4,col5,col6
3,col1,col2,col3,col4,col5,col6

Iam basically trying to do is:-

if this record has a column value of x then do y else do z
get next record
 
If the number of columns to be returned is undetermined, storing all the rows in a two-dimensional array is risky. What happens if your query returns 2 million rows?

When you fetch the data from the database, all of PHP's fetching functions return 1-dimensional arrays. Why not just loop through the returned arrays and do what you need to do?

Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top