scottyrob
01-30-2007, 01:06 PM
Hi, im getting this error with the following code and i cant figure out why!
Query failed (INSERT INTO tblExplorerGroup (F_Name, S_Name, Address, Town, Postcode, Mobile_No, Home_No, Email, DoB, Age, Base, Former_Group, Parent1_Name, Parent1_Email, Parent1_Phone1, Parent1_Phone2, Parent2_Name, Parent2_Email, Parent2_Phone1, Parent2_Phone2, YoungLeader, Subscription_Ref, Subscription_Status, GiftAid_Status, NightsAway, Meetings_Attended, VACC_Balanace, Health_Notes, Notes, HomeIssues, Admin) VALUES(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, z, aa, , bb, cc, dd, ee)) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' bb, cc, dd, ee)' at line 1
This error has been reported! Please check back again shortly when we hope to have this error resolved!
<?
include("DbConnect.php");
$ID = $_POST["ID"];
$F_Name = $_POST["F_Name"];
$S_Name = $_POST["S_Name"];
$Address = $_POST["Address"];
$Town = $_POST["Town"];
$Postcode = $_POST["Postcode"];
$Mobile_No = $_POST["Mobile_No"];
$Home_No = $_POST["Home_No"];
$Email = $_POST["Email"];
$DoB = $_POST["DoB"];
$Age = $_POST["Age"];
$Base = $_POST["Base"];
$Former_Group = $_POST["Former_Group"];
$Parent1_Name = $_POST["Parent1_Name"];
$Parent1_Email = $_POST["Parent1_Email"];
$Parent1_Phone1 = $_POST["Parent1_Phone1"];
$Parent1_Phone2 = $_POST["Parent1_Phone2"];
$Parent2_Name = $_POST["Parent2_Name"];
$Parent2_Email = $_POST["Parent2_Email"];
$Parent2_Phone1 = $_POST["Parent2_Phone1"];
$Parent2_Phone2 = $_POST["Parent2_Phone2"];
$YoungLeader = $_POST["YoungLeader"];
$Subscription_Ref = $_POST["Subscription_Ref"];
$Subscription_Status = $_POST["Subscription_Status"];
$GiftAid_Status = $_POST["GiftAid_Status"];
$NightsAway = $_POST["NightsAway"];
$Meetings_Attended = $_POST["Meetings_Attended"];
$VACC_Balance = $_POST["VACC_Balance"];
$Health_Notes = $_POST["Health_Notes"];
$Notes = $_POST["Notes"];
$HomeIssues = $_POST["HomeIssues"];
$Admin = $_POST["Admin"];
$sql = "INSERT INTO tblExplorerGroup (F_Name, S_Name, Address, Town, Postcode, Mobile_No, Home_No, Email, DoB, Age, Base, Former_Group, Parent1_Name, Parent1_Email, Parent1_Phone1, Parent1_Phone2, Parent2_Name, Parent2_Email, Parent2_Phone1, Parent2_Phone2, YoungLeader, Subscription_Ref, Subscription_Status, GiftAid_Status, NightsAway, Meetings_Attended, VACC_Balanace, Health_Notes, Notes, HomeIssues, Admin) VALUES($F_Name, $S_Name, $Address, $Town, $Postcode, $Mobile_No, $Home_No, $Email, $DoB, $Age, $Base, $Former_Group, $Parent1_Name, $Parent1_Email, $Parent1_Phone1, $Parent1_Phone2, $Parent2_Name, $Parent2_Email, $Parent2_Phone1, $Parent2_Phone2, $YoungLeader, $Subscription_Ref, $Subscription_Status, $GiftAid_Status, $NightsAway, $Meetings_Attended, $VACC_Balanace, $Health_Notes, $Notes, $HomeIssues, $Admin)";
$query = mysql_query($sql) or dying_mail("Query failed ($sql) " . mysql_error() . "<br><br>This error has been reported! Please check back again shortly when we hope to have this error resolved!");
echo "<meta http-equiv='refresh' content='0; url=ManageExplorer.php' />";
?>
<script type="text/javascript">
window.alert("The record for <?php echo $F_Name; echo " "; echo $S_Name ?> has been added. You will now be redirected");
</script>
Cheers
Query failed (INSERT INTO tblExplorerGroup (F_Name, S_Name, Address, Town, Postcode, Mobile_No, Home_No, Email, DoB, Age, Base, Former_Group, Parent1_Name, Parent1_Email, Parent1_Phone1, Parent1_Phone2, Parent2_Name, Parent2_Email, Parent2_Phone1, Parent2_Phone2, YoungLeader, Subscription_Ref, Subscription_Status, GiftAid_Status, NightsAway, Meetings_Attended, VACC_Balanace, Health_Notes, Notes, HomeIssues, Admin) VALUES(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, z, aa, , bb, cc, dd, ee)) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' bb, cc, dd, ee)' at line 1
This error has been reported! Please check back again shortly when we hope to have this error resolved!
<?
include("DbConnect.php");
$ID = $_POST["ID"];
$F_Name = $_POST["F_Name"];
$S_Name = $_POST["S_Name"];
$Address = $_POST["Address"];
$Town = $_POST["Town"];
$Postcode = $_POST["Postcode"];
$Mobile_No = $_POST["Mobile_No"];
$Home_No = $_POST["Home_No"];
$Email = $_POST["Email"];
$DoB = $_POST["DoB"];
$Age = $_POST["Age"];
$Base = $_POST["Base"];
$Former_Group = $_POST["Former_Group"];
$Parent1_Name = $_POST["Parent1_Name"];
$Parent1_Email = $_POST["Parent1_Email"];
$Parent1_Phone1 = $_POST["Parent1_Phone1"];
$Parent1_Phone2 = $_POST["Parent1_Phone2"];
$Parent2_Name = $_POST["Parent2_Name"];
$Parent2_Email = $_POST["Parent2_Email"];
$Parent2_Phone1 = $_POST["Parent2_Phone1"];
$Parent2_Phone2 = $_POST["Parent2_Phone2"];
$YoungLeader = $_POST["YoungLeader"];
$Subscription_Ref = $_POST["Subscription_Ref"];
$Subscription_Status = $_POST["Subscription_Status"];
$GiftAid_Status = $_POST["GiftAid_Status"];
$NightsAway = $_POST["NightsAway"];
$Meetings_Attended = $_POST["Meetings_Attended"];
$VACC_Balance = $_POST["VACC_Balance"];
$Health_Notes = $_POST["Health_Notes"];
$Notes = $_POST["Notes"];
$HomeIssues = $_POST["HomeIssues"];
$Admin = $_POST["Admin"];
$sql = "INSERT INTO tblExplorerGroup (F_Name, S_Name, Address, Town, Postcode, Mobile_No, Home_No, Email, DoB, Age, Base, Former_Group, Parent1_Name, Parent1_Email, Parent1_Phone1, Parent1_Phone2, Parent2_Name, Parent2_Email, Parent2_Phone1, Parent2_Phone2, YoungLeader, Subscription_Ref, Subscription_Status, GiftAid_Status, NightsAway, Meetings_Attended, VACC_Balanace, Health_Notes, Notes, HomeIssues, Admin) VALUES($F_Name, $S_Name, $Address, $Town, $Postcode, $Mobile_No, $Home_No, $Email, $DoB, $Age, $Base, $Former_Group, $Parent1_Name, $Parent1_Email, $Parent1_Phone1, $Parent1_Phone2, $Parent2_Name, $Parent2_Email, $Parent2_Phone1, $Parent2_Phone2, $YoungLeader, $Subscription_Ref, $Subscription_Status, $GiftAid_Status, $NightsAway, $Meetings_Attended, $VACC_Balanace, $Health_Notes, $Notes, $HomeIssues, $Admin)";
$query = mysql_query($sql) or dying_mail("Query failed ($sql) " . mysql_error() . "<br><br>This error has been reported! Please check back again shortly when we hope to have this error resolved!");
echo "<meta http-equiv='refresh' content='0; url=ManageExplorer.php' />";
?>
<script type="text/javascript">
window.alert("The record for <?php echo $F_Name; echo " "; echo $S_Name ?> has been added. You will now be redirected");
</script>
Cheers