Re: [PHP-DB] Changing part of a query before displaying it

2009-07-15 Thread Patrick Price
Yes, the while loop will retrieve all the rows from the database. The foreach loop you had been using was retrieving all the data from each row. The only appreciable difference between your code and mine is in the circumstance, if you added more columns to the database, you would need to add more

Re: [PHP-DB] Changing part of a query before displaying it

2009-07-15 Thread Don Collier
Would that work for multiple rows though? This is getting a varying number of rows. Patrick Price wrote: I believe your best bet is to change how you are iterating through the $row data. Since there are only 6 columns of data, I think the simplest solution is to remove the foreach() and h

Re: [PHP-DB] Changing part of a query before displaying it

2009-07-15 Thread Patrick Price
I believe your best bet is to change how you are iterating through the $row data. Since there are only 6 columns of data, I think the simplest solution is to remove the foreach() and handle each column's data independently, ie: while($row = mysql_fetch_row($result10)) { print '

[PHP-DB] Changing part of a query before displaying it

2009-07-15 Thread Don Collier
I am quite new at this so please bare with me. I am getting a several rows of data from a database to display in a table. One of the fields is in a format that I want to change before putting it in the table. The field is time in seconds, but I want it to be displayed in minutes instead. Be