Trying to populate new rows on a table
Hi all, I am trying to produce an ordering mechanism for photo prints. Each photo has properties 'url', 'alt_text', 'caption', 'order_size', 'surface_type', and 'id' (auto-increment). The images will be uploaded to the server, and dynamically displayed via Repeat Region. In order to show all the images, I need to have that number of rows in my table. I have tried using a 'for' loop with a max-value taken from a text field and then posting it the the URL, then reading it from there. I'm not sure how to take the automatically created Insert Record script and use it multiple times automatically. Here is the code from my test page, instead of displaying the image, I want to add new rows:
<?php
$filename = "image";
$string;
echo '<table>';
for ($counter=1; $counter<=$_GET['times']; $counter++)
{
$row_number += 1;
echo '<tr><td><img src="/images/test_gallery/image'.$row_number.'.jpg" width="205" height="308"></td></tr>';
}
echo '</table>';
?>
This works perfectly, taking the number of iterations from the URL variable. Now instead of writing the images, I want it to insert new records (I can theoretically add the rest of the table fields to the form - URL, alt_text etc.). Thanks in advance for help!
P.S. This is how DW connects to the table (I assume, since I don't know that much PHP)
<?php
mysql_select_db($database_cias, $cias);
$query_photos = "SELECT * FROM photos";
$photos = mysql_query($query_photos, $cias) or die(mysql_error());
$row_photos = mysql_fetch_assoc($photos);
$totalRows_photos = mysql_num_rows($photos);
?>
Comments
Be the first to write a comment
You must me logged in to write a comment.