Search the Community
Showing results for tags 'records'.
-
I am using the scripts in the 2nd edition and am trying to call records from the mysql dbase and arrange them into a table with three records to each row. I hope it is possible but all the suggestions I have found so far dont work. (maybe because the suggestions are for more advanced versions of php?). I can display records one row at a time (and am even using the pagination script to paginate every 6 records) however every time I try and get three records on the same row I fail. The following is from a script that is working great (used to be script 13.6 ) - but only shows one record per row. Does anyone know how this can become three records per row?..I only really need to have three images per row as this is a gallery (and each images was to act as a link to a page of its own where it could be viewed on its own as much bigger). Sorry for long-winded request. Thanks echo '<table border="0" width="94%" cellspacing="13" cellpadding="10" align="center"> <tr> </tr>'; // Display all the URLs. $result = mysql_query ($query); while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { // Display each record. echo " <tr> <td rowspan=\"4\" align=\"left\"><img src=\"Uploads/{$row['image_name']}\"width=\"250\" $image[3] alt=\"{$row['print_name']}\" /></td> <td align=\"left\">Title : <font=\"Agency FB\" size=\"+1\"><b><a href=\"view_print.php?pid={$row['print_id']}\">{$row['print_name']}</a></b></font></td></tr> <tr><td align=\"left\">Description : " . stripslashes($row['description']) . "</td></tr> <tr><td align=\"left\">Price : £{$row['price']}</td></tr> <tr><td align=\"left\">Status : {$row['type']}</td> </tr>\n"; } // End of while loop. echo '</table>'; // Close the table. mysql_close(); // Close the database connection.
- 12 replies