Wednesday 15 September 2010

php - Resource id #6 error, Not sure how to fix it -


I would get when a 'resource ID # 6' failure to submit a script on your website. The code I am using is the same type of code that I use to register for the website and it works but this script does not work at all. What my code does, sends a booking request with the fields shown in the form of a database. I am receiving a resource ID # 6 error, and I think what it is, but I can not find what is wrong? I have no suggestions on what to see in php will be just the beginning, a lot

help a resource ID # 6 error to avoid
  & lt, php // $ patterns = "/ ... ^ + @ + / com /"; // error_reporting (0); If (isset ($ _post ["submit"])) {$ Name_of_Person = $ _POST ['Name_of_Person']; $ Name_fulf_group = $ _POST ['name_off_group']; $ Room = $ _POST ['cell']; $ How_Many_People = $ _POST ['How_Many_People']; $ Date_ of_Booking = $ _POST ['Date_of_Booking']; $ End_time = $ _POST ['end_time']; $ Objective = $ _POST ['Purpose']; $ Contact_Number = $ _POST ['contact_number']; $ Contact_email = $ _POST ['contact_email']; $ Alcohol = $ _POST ['alcohol']; $ Security = $ _POST ['security']; $ Projector = $ _POST ['projector']; $ Extra_chairs = $ _POST ['extra_chairs']; $ Extra_Info = $ _POST ['Extra_Info']; $ Active = '0'; $ Thor = mysql_connect ('localhost', 'root', 'test123') or die ("could not connect"); Mysql_select_db ('bookerdb') or die ("can not connect to DB"); // if (filter_var ($ email, FILTER_VALIDATE_EMAIL)) {// (preg_match ($ pattern, $ _POST [ 'contact_email'])) {$ query = mysql_query (. Select the $ "` Booking_table` where Date_of_Booking = '* " Date_of_Booking. "'And Room ='". $ Room. "'"); $ Numrows = mysql_num_rows ($ query); Echo $ query; If ($ numrows == 0) {$ sql = "` putting booking_table` (Name_of_Person, Name_of_Group, room, How_Many_People, Date_of_Booking, END_TIME, purpose, Contact_Number, Contact_email, alcohol, security, projectors, Extra_Chairs, Extra_Info, active) values ( '$ Name_of_Person' $ Name_of_Group '$ Panel', '$ How_Many_People' $ Date_of_Booking '$ End_time' $ object, '' $ Contact_Number '$ liquor' '$ protection' , '$ Projector', '$ Extra_Chairs', '$ Extra_Info', $ Active) "; $ Result = mysql_query ($ sql); If ($ result) {resonant "sent to be approved"; $ Redirect_page = '../ASC.php'; $ Redirect = true; If ($ redirect == true) {Header ('location:'. $ Redirect_page); }} And {echo "unsuccessful"; }} Else {echo "is already a requested booking on that date and time"; $ Redirect_page = '../EAR.php'; $ Redirect = true; If ($ redirect == true) {Header ('location:'. $ Redirect_page); }} / *} And {echo "error"; $ Redirect_page = '../EWF.php'; $ Redirect = true; If ($ redirect == true) {Header ('location:'. $ Redirect_page); }} *? & Gt;  

"itemprop =" text ">

You have an error in your second SQL query. You try to insert 14 values ​​in 15 columns (assuming you forget $ contact_email ).

$ sql = "Entering` _mark_table` (Name_of_Person, Name_of_Group, Room, How_Many_People, Date_of_Booking, END_TIME, Purpose, Contact_Number, contact_email, Alcohol, Security, Projector, Extra_Chairs, Extra_Info, Active) vALUES ( '$ Name_of_Person', '$ Name_of_Group', '$ Panel', '$ How_Many_People', '$ Date_of_Booking', '$ end_time', '$ object', '$ Contact_Number', '$ contact_email', '$ ale ',' $ Security ',' $ projector ',' $ Extra_Chairs', '$ Extra_Info', $ activated) "; $ query echo from your code , line 30, to remove

.

does not have query in the $ query , but the mysql result object can not work with it in this way, you can not echo it.


No comments:

Post a Comment