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
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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!

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.