Jump to content

Help in code?


kyuu

Recommended Posts

 

## Could someone tell me what is wrong with this code. I want to insert certain values in fileds into my table. 

using a form.

Thanks

 

<?php

 

 

$host      = "localhost";

$user      = "";

$password  = "";

 

$db        = "MedicalMangementSystem";

$table    = "medicalrecord ";

 

$Blood  = $_POST['T1'];

$Pulse  = $_POST['T2'];

$Temp  = $_POST['T3'];

$height = $_POST['T4'];

$weight = $_POST['T5'];

 

 

    $conn=mysql_connect($host,$user,$password) or die("Failed to connect");

    mysql_select_db($db) or die("Falied to select database");

 

 

    $sql = "INSERT INTO $table(BloodPressure , Pulse, Height, Weight , Temperature )

    VALUES ('$Blood','$Pulse','$height','$weight','$Temp');"

 

  if (mysql_query($sql)){

        echo "<font size=4><center><br><br><br>Patient Information was inserted successfully";

 

 

    } else echo "mysql Error: " . mysql_error();

 

 

    mysql_close($conn);

 

?>

 

Link to comment
https://forums.phpfreaks.com/topic/44007-help-in-code/
Share on other sites

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.