Forum Moderators: open
I'm pretty new with mySQL, and have a question about a query that is probably laughably simple, but I can't seem to figure it out.
I have a table with 6 fields (part1, part2,...), and I need to retrieve say the 4th row of data which I will use as seperate variables in php, example for part1, $p1 = mysql_fetch_array($query)
so do I need to do a query for each separate field, and how do I call them by their index?
Sorry if this is really simple, but I have been researching this and getting kinda frustrated.
Thanks
Records represent each an object you've catalogued in your table, while a column represents a property and a field represents the value the property has for the object represented by the row.
That said, the php function mysql_fetch_array($query) returns an array which contains all the field values of the ACTIVE record only, so you'll want to repeat the calls to mysql_fetch_array to read all the records one by one.
Then , inside the array returned by mysql_fetch_array you'll fin field values in the same order they have in the record, numbered strating with 0: if you've done $record=mysql_fetch_assoc($queryhandle) , then $record[0] whould contain the first filed value, $record[1] would be the second field's value and so on.
Did i clarify your issue? :)