hey all,
I would like to create a form that does the following: [I have up to step 3 completed.]

1. queries a db and gets the values of ID, TITLE, and FILENAME
2. generates a form that with a text input area for each TITLE where i can enter the 
filename of the picture that corresponds to the TITLE
3. echo's the current value in the input box if a value is present
4. UPDATES the FILENAME column

I am trying to insert the filename of the pictures that correspond to each TITLE.  I 
think that i need to use some sort of loop and also somehow tie the ID to each input 
so that the UPDATE executes correctly.

thanks much, 
olinux 

Here's some of my code. 

This generates the form inputs

while ($row = mysql_fetch_array($result)) {
  $id = $row['id'];
  $title = $row['title'];
  $filename = $row['filename'];

$form .= "$title <input type=\"text\" name=\"$id\" size=15 maxlength=20";

if ($filename) {
   $form .= " VALUE=\"$filename\"";
   }

$form .= "><br>";
// end while
}

Here is my insert that is not yet working.

$sql .= "UPDATE $table_name SET filename=\"$id\"";

$result = mysql_query($sql) or die ('Could not insert filenames');

Reply via email to