FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Edit a record?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Edit a record? [message #176201 is a reply to message #176199] Sat, 03 December 2011 14:15 Go to previous messageGo to previous message
Denis McMahon is currently offline  Denis McMahon
Messages: 634
Registered: September 2010
Karma:
Senior Member
On Sat, 03 Dec 2011 05:28:42 -0800, Charles wrote:

> 1) Present a data entry form to enter the values on which the record
> selection is based (an HTML form with 5 input fields...this I have). 1)
> Query the database for the record (Submit for processing to a PHP script
> that opensn the database and submits the values for a SELECT query).
>
> =========={this is where I am stuck]==============
>
> 3) Somehow import those returned values into a form for editting. 4)
> Indicate somehow (in the form) which records (if more than one) need to
> be returned as updated to the MySQL database. 5) Somehow post to
> database
>
> Anyone have any ideas they'd care to share?

A select query assembled using the data submitted in your form (perhaps
the name data) and selecting the date of birth data from the table

don't forget to escape any parameters from the form that you use in a
query, also you might want to validate names (alphabetics, spaces,
hyphens, possibly ' characters eg O'Leary) and dates (numerics only).

You might use an html "select" and option list for the month?

Anyway, use mysql / myslqli / pdo functions (your choice, it's up to you
at this point) to open and interrogate the db to read the record you want
to edit, then display that record in a form using the value attribute or
the selectedindex of the various html form elements to display the data
you want to edit.

Then, once the data is edited and submitted, the next script will update
the records in the table.

If you look in the php documentation for the relevant database functions
there are a lot of examples.

Rgds

Denis McMahon
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: regex help
Next Topic: Upload xlsx /xls and save to DB using minimum memory?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 12:33:39 GMT 2024

Total time taken to generate the page: 0.07803 seconds