Reply to Re: Updating MySQL with PHP

Your name:

Reply:


Posted by J.O. Aho on 07/18/07 04:24

Ronald Schow wrote:
> The page I want to update is similar to "http:www.hospiceslo.org/events.php"
> (read only). On my update page I've got the same table as a FORM where the
> client can make changes to the fields. The problem I'm having is updating
> the MySQL data base with the content of the form. I have no clue and would
> like to know where to start. Can I get some pointers to references or
> examples, even suggestions, on how this can be successfully done?

Without checking what the user has sent

//assume you have already connected to the database
//if not see the online manual for mysql_connect()
$query("UPDATE tablename SET column1='{$_REQUEST['column1']}',
column2='{$_REQUEST['column2']}', column3='{$_REQUEST['column3']}' WHERE
keycolumn='{$_REQUEST['keycolumn']}'";
mysql_query($query);

In your form you have a hidden field keycolumn which has the rows primary key
value and then you name the options that the user can update for column1,
column2, ...


--

//Aho

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация