Dear all

I am putting together some pages where I will be able to update mysql
database using php pages. I am having a problem with updating. I put a
record into textboxes and when I press submit it passes the values to the
next page. The problem I am having is updating the values. Here is my


  $MySQLLink = mysql_pconnect ("davecp4", "root", "")
   or die("Could not attach to database. Please try later or contact
   mysql_select_db($database_name, $MySQLLink) or die("ERROR--CAN'T CONNECT
TO DB");

   $result = mysql_query("SELECT * FROM ".$table_name) or die("Error: " .

   for($i = 1; $i < mysql_num_fields($result); $i++)
    $fieldname = mysql_field_name($result, $i);
    $fieldname2 = "$".$fieldname;
    mysql_query("UPDATE $table_name SET $fieldname=$fieldname2 WHERE id
    echo $fieldname."<br>".$fieldname2."<br>";


Kind Regards

Anagram Systems

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to