kyuu Posted March 23, 2007 Share Posted March 23, 2007 ## 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 More sharing options...
Hell Toupee Posted March 23, 2007 Share Posted March 23, 2007 You need to tell us what errors you got or what bits are working/ aren't working. Also, paste the html for your form, the problem could lie there. Link to comment https://forums.phpfreaks.com/topic/44007-help-in-code/#findComment-213683 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.