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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.