Question #241228

Write a PYTHON program

Create a data record in MySQL using patient meta data,
Create Json and parse it through PHP and show details in Html
Provide search option to filter the data using jQuery plugin

Expert's answer

import mysql.connector


mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  password="12345",
  database="test"
)


query = mydb.cursor()


query.execute("CREATE TABLE patient (patient_id INT ,name VARCHAR(255), address VARCHAR(255))")
create_record =  "INSERT INTO patient (patient_id,name, address) VALUES (1, "John" "john@gmail.com")"
query.execute(create_record)
query.execute("SELECT * FROM patient")
result = query.fetchall()

import json
resultLoaded = json.loads(result)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS