Jump to content

Updating records in MySQL database using dreamweaver...


Recommended Posts

I\'m having troubles getting some records to update in the MySQL database.

 

As soon as you change the values to all numeric nothing will update. I have 4 fields (ID, model, serial, and location). Each is set to submit as the following:

 

ID: Integer (primary key)

model: Text

serial: Text

location: Text

 

In the database columns are set as:

 

ID: INT (NOT_NULL) Primary

model: TEXT (NOT_NULL)

serial: TEXT (NOT_NULL)

location: LONGTEXT (NOT_NULL)

 

All the updating works fine as long as you keep all fields alphanumeric, as soon as you change one to strictly numeric after that nothing will update.

 

I can\'t figure this out and I\'m new to PHP/MySQL.

 

Please help.

 

Thanks.

You will have to build your own SQL statement:

 

$sql=\"UPDATE tablename SET field1 = \'\".$_POST[\'field1\'].\"\', field2 = \'\".$_POST[\'field2\'].\"\' WHERE id_field = \'\".$_POST[\'id_field\'].\"\';\" ;

Execute($sql);

 

You should go to http://www.interakt.ro/products/catlist.php?id_pct=2

 

and download the PHAkt extention (free) which automates a whole lot of database interactions. You have to use a different type of connection to you MySQL database, but it as well is automated. There are tutorials on the site as how to use this powerful tool.

 

hope this helps.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.