Jump to content


Photo

Updating records in MySQL database using dreamweaver...


  • Please log in to reply
1 reply to this topic

#1 tacojohn

tacojohn
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 11 June 2003 - 02:31 PM

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.

#2 karassik

karassik
  • Members
  • PipPip
  • Member
  • 13 posts
  • LocationPortland, Oregon

Posted 13 June 2003 - 06:10 PM

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....st.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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users