Joey46 Posted March 4, 2009 Share Posted March 4, 2009 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 More sharing options...
Synook Posted March 4, 2009 Share Posted March 4, 2009 You have a stray comma in the last SQL statement (two stray commas...). Link to comment Share on other sites More sharing options...
Joey46 Posted March 5, 2009 Author Share Posted March 5, 2009 You have a stray comma in the last SQL statement (two stray commas...).Thank you Synook that is working now Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.