Jump to content

HTML form -> SQL database


mastubbs

Recommended Posts

Hi all,

 

I have very limited knowledge of HTML and SQL but I’m trying to create a web user interface to allow updating of medical records.

 

The idea is to use an HTML web form to search a SQL database for a record based on a patient number, and return and display the patients name and date of birth, along with another form that can be used to enter a new record for that patient which could then update the database by adding this record. (ie would need to create a new database table with date, time and whatever data was input into the form (say 5 more fields).

 

Im guessing that to do this one would need to pass the data using PHP somehow, but im afraid I don’t have enough knowledge of how. Can anybody help advise me on how to do this?

 

Thanks in advance for any replies,

 

Matt

Link to comment
https://forums.phpfreaks.com/topic/278074-html-form-sql-database/
Share on other sites

  On 5/16/2013 at 5:20 PM, Jessica said:

Sounds like a basic CRUD.

 

I wrote a tutorial on building a basic CRUD, here: http://thewebmason.com/php-mysql-crud-tutorial-using-pdo-create-read-update-delete-part-1-create/

 

Hi thanks for the response. I will have a good look through that, thanks. The bit that might be a bit complex is that each time a patient record is accessed i want to add a new row to a table to store a few variables (eg date time blood pressure heart rate etc...) the aim is to be able to pull this data into a graphical observation chart. Does your tutorial explain how to add new rows under the selected record in this way?

 

thanks

  On 5/16/2013 at 5:20 PM, Jessica said:

Sounds like a basic CRUD.

 

I wrote a tutorial on building a basic CRUD, here: http://thewebmason.com/php-mysql-crud-tutorial-using-pdo-create-read-update-delete-part-1-create/

 

Ok so ive been experimenting based on your tutorial (which was very useful by the way, thanks!). Im still having that same problem though. Im trying to figure out how a user could open a patient, and add a new data under that patient with a automatic date and time added to it, without overwriting the old data. Hummm....

Glad the tutorial helped you.

 

Each patient will have several records, so this is known as a many-to-one relationship. You should have one table for patients, and one for records. The records table will have a foreign key for patient ID. Do you already have that set up?

  On 5/17/2013 at 6:36 PM, Jessica said:

Glad the tutorial helped you.

 

Each patient will have several records, so this is known as a many-to-one relationship. You should have one table for patients, and one for records. The records table will have a foreign key for patient ID. Do you already have that set up?

 

Hia,

 

Ahhh... ok I see. So i've managed to set up both tables using your tutorial. table_patients contains ID, name, dob and hospital number. table_records contains ID heart rate and blood pressure. How do i set it up so that the table knows ID is a foreign key?

 

Thanks so much for the help!

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.