Jump to content

Database


Joey46

Recommended Posts

I keep getting an error and have tried several things to fix this but nothing is working could someone please help me this is my PHP code<?php$host = 'db.kwilliams.cessnock-ict.net';$user = 'kgillis';$pswd = 'student1';$myDB = 'kgillisdb';$conn = mysql_connect($host, $user, $pswd);@mysql_select_db($myDB, $conn) or die ("WHOOPS Problem");$ID =$_POST['Module_I.D'];$Name =$_POST['Module_Name'];$Number =$_POST['Module_Number'];$Hours =$_POST['Nominal_Hours'];$sql = "INSERT into Modules (Module_I.D, Module_Name, Module_Number, Nominal_Hours,) values ('$Module_I.D', '$Module_Name', '$Module_Number', '$Nominal_Hours',)"; if(mysql_query($sql, $conn)){ echo "<h4> module Added! </h4>"; } else { echo "<h4> ITS DEAD DUE TO ERROR</h4>"; } ?>

Link to comment
Share on other sites

You have a stray comma in the last SQL statement (two stray commas...).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...