Jump to content

Posting to MySql from form


AdsTwyx

Recommended Posts

Hi All,

 

I am a bit of a noob with php but I am in the process of learning so I will apologise in advance if nayone finds this 'Too Easy' to be on here.

 

Anyhow, I have a form ( add_venue.php ) which a user completes and then osts into MySql. The trouble I am having is that I fill out the form and Submit but it is not posting into the database. I placed an 'echo' of the details to appear on the page after submisison which seems to be fine but the data is not posting in the table.

 

Could someone have a look at the code to see if anything is glaringly obvious that I have missed?

 

Thanks

Link to comment
Share on other sites

I had spotted this and adjusted, now I am getting the message "#1136 - Column count doesn't match value count at row 1" . I have checked the fields and values and both match BUT I do have a an 'id' field which is AUTO INCREMENT. Would this cause issues also? How do I get round it?

Link to comment
Share on other sites

Well spotted, Thanks Barand and Jacques for your Eagle Eyes :)

 

The fun keeps coming though unfortunately, I have amended what has been spotted but the info is still not posting into the Table and I am still getting teh following error

 

"#1136 - Column count doesn't match value count at row 1" .....

Link to comment
Share on other sites

so this is the add_venue page...

<?php
include("../includes/header.php");
?>
<div class="container">

<?php 

                                                 		
	if (strlen($_POST["Name"]) > 0)
	{
		//echo $Name;
		// INSERT 
			
	
		$Name = mysql_real_escape_string($_POST["Name"]);
		$Address1 = mysql_real_escape_string($_POST["Address1"]);
		$Address2 = mysql_real_escape_string($_POST["Address2"]);
		$Town = mysql_real_escape_string($_POST["Town"]);
		$County = mysql_real_escape_string($_POST["County"]);
		$Country = mysql_real_escape_string($_POST["Country"]);
		$Postcode = mysql_real_escape_string($_POST["Postcode"]);
		$Website = mysql_real_escape_string($_POST["Website"]);
		$Telephone = mysql_real_escape_string($_POST["Telephone"]);
		$Email = mysql_real_escape_string($_POST["Email"]);
		$OpenMon = mysql_real_escape_string($_POST["OpenMon"]);
		$CloseMon = mysql_real_escape_string($_POST["CloseMon"]);
		$OpenTue = mysql_real_escape_string($_POST["OpenTue"]);
		$CloseTue = mysql_real_escape_string($_POST["CloseTue"]);
		$OpenWed = mysql_real_escape_string($_POST["OpenWed"]);
		$CloseWed = mysql_real_escape_string($_POST["CloseWed"]);
		$OpenThu = mysql_real_escape_string($_POST["OpenThu"]);
		$CloseThu = mysql_real_escape_string($_POST["CloseThu"]);
		$OpenFri = mysql_real_escape_string($_POST["OpenFri"]);
		$CloseFri = mysql_real_escape_string($_POST["CloseFri"]);
		$OpenSat = mysql_real_escape_string($_POST["OpenSat"]);
		$CloseSat = mysql_real_escape_string($_POST["CloseSat"]);
		$OpenSun = mysql_real_escape_string($_POST["OpenSun"]);
		$CloseSun = mysql_real_escape_string($_POST["CloseSun"]);
		$MembersOnly = mysql_real_escape_string($_POST["MembersOnly"]);
		$EnglishTables = mysql_real_escape_string($_POST["EnglishTables"]);
		$NineBallTables = mysql_real_escape_string($_POST["9BallTables"]);
		$SnookerTables = mysql_real_escape_string($_POST["SnookerTables"]);
		$EnglishTableRates = mysql_real_escape_string($_POST["EnglishTableRates"]);
		$NineBallTableRates = mysql_real_escape_string($_POST["9BallTableRates"]);
		$SnookerTableRates = mysql_real_escape_string($_POST["SnookerTableRates"]);
		$NoTeamsPoolWorld = mysql_real_escape_string($_POST["NoTeamsPoolWorld"]);
		$NoTeams9Ball = mysql_real_escape_string($_POST["NoTeams9Ball"]);
		$NoTeamsBlackball = mysql_real_escape_string($_POST["NoTeamsBlackball"]);
		$NoTeamsSnooker = mysql_real_escape_string($_POST["NoTeamsSnooker"]);
		$Latitude = mysql_real_escape_string($_POST["Latitude"]);
		$Longitude = mysql_real_escape_string($_POST["Longitude"]);
		$About = mysql_real_escape_string($_POST["About"]);
		$Food = mysql_real_escape_string($_POST["Food"]);
		$TV = mysql_real_escape_string($_POST["TV"]);
		$LicencedBar = mysql_real_escape_string($_POST["LicencedBar"]);
		$Image = mysql_real_escape_string($_POST["Image"]);
		$Image2 = mysql_real_escape_string($_POST["Image2"]);
		$Image3 = mysql_real_escape_string($_POST["Image3"]);
		$Image4 = mysql_real_escape_string($_POST["Image4"]);
		$Image5 = mysql_real_escape_string($_POST["Image5"]);
		$Image6 = mysql_real_escape_string($_POST["Image6"]);                              
	 
	  $mysql = 'INSERT INTO Venues(Name, Address1, Address2, Town, County, Country, Postcode, Website, Telephone, Email, OpenMon, CloseMon, OpenTue, CloseTue. OpenWed, CloseWed, OpenThu, CloseThu, OpenFri, CloseFri, OpenSat, CloseSat, OpenSun, CloseSun, MembersOnly, EnglishTables, 9BallTables, SnookerTables, EnglishTableRates, 9BallTableRates, SnookerTableRates, NoTeamsPoolWorld, NoTeams9Ball, NoTeamsBlackball, NoTeamsSnooker, Latitude, Longitude, About, Food, TV, LicencedBar, Image, Image2, Image3, Image4, Image5, Image6) 
	  
	  VALUES (
	  "'.$Name.'", 
	  "'.$Address1.'", 
	  "'.$Address2.'", 
	  "'.$Town.'", 
	  "'.$County.'", 
	  "'.$Country.'", 
	  "'.$Postcode.'", 
	  "'.$Website.'", 
	  "'.$Telephone.'", 
	  "'.$Email.'", 
	  "'.$OpenMon.'", 
	  "'.$CloseMon.'", 
	  "'.$OpenTue.'", 
	  "'.$CloseTue.'", 
	  "'.$OpenWed.'", 
	  "'.$CloseWed.'", 
	  "'.$OpenThu.'", 
	  "'.$CloseThu.'", 
	  "'.$OpenFri.'", 
	  "'.$CloseFri.'", 
	  "'.$OpenSat.'", 
	  "'.$CloseSat.'", 
	  "'.$OpenSun.'", 
	  "'.$CloseSun.'", 
	  "'.$MembersOnly.'", 
	  "'.$EnglishTables.'", 
	  "'.$NineBallTables.'", 
	  "'.$SnookerTables.'", 
	  "'.$EnglishTableRates.'", 
	  "'.$NineBallTableRates.'", 
	  "'.$SnookerTableRates.'", 
	  "'.$NoTeamsPoolWorld.'", 
	  "'.$NoTeams9Ball.'", 
	  "'.$NoTeamsBlackball.'", 
	  "'.$NoTeamsSnooker.'", 
	  "'.$Latitude.'", 
	  "'.$Longitude.'", 
	  "'.$About.'", 
	  "'.$Food.'", 
	  "'.$TV.'", 
	  "'.$LicencedBar.'", 
	  "'.$Image.'", 
	  "'.$Image2.'", 
	  "'.$Image3.'", 
	  "'.$Image4.'", 
	  "'.$Image5.'", 
	  "'.$Image6.'"';
	  
	  echo $mysql;

		// excecute the SQL on MySQL
	  $result =	mysql_query($mysql);	
	  
	  echo $result;
	}
?>

<!--STart of Old Add

    }
}
End of add-->


<div class="row" id="features">
    <div class="col-sm-12 feature">
        <div class="panel">
            <form method="post">
                <center><h1><u>Venue Setup Form</u></h1></center>

                <p>
                    <input type="hidden" id="Latitude" name="Latitude" value="50.992376" placeholder="Latitude" step="any" style="width: 48%" />
                    <input type="hidden" id="Longitude" name="Longitude" value="50.992376" placeholder="Longitude" step="any" style="width: 48%" />
                </p>

                <p>
                    <b>
                        Please fill out the form below as acurately as possible. Remember, All the details that are entered here will be
                        available for others to view when searching PoolHQ for Leagues.
                    </b>
                </p>

                <p><font style="color: red;"><b>Fields marked * are required</b></p></font>
                <b>
                    <table align="center">
                        <tr>
                            <td>Venue Name*</td>
                            <td><input type="text" name="Name" required /></td>
                        </tr>
                        <tr>
                            <td>Address*</td>
                            <td><input type="text" name="Address1" required /></td>
                        </tr>
                        <tr>
                            <td>Address</td>
                            <td><input type="text" name="Address2" /></td>
                        </tr>
                        <tr>
                            <td>Town</td>
                            <td><input type="text" name="Town" /></td>
                        </tr>
                        <tr>
                            <td>County</td>
                            <td><input type="text" name="County" required /></td>
                        </tr>
                        <tr>
                            <td>Country*</td>
                            <td><input type="text" name="Country" required /></td>
                        </tr>
                        <tr>
                            <td>Postcode</td>
                            <td><input type="text" id="PostCode" name="PostCode" required onChange="updateLatitudeLongitude()" /></td>
                        </tr>
                        <tr>
                            <td>Website*</td>
                            <td><input type="text" name="Website" required/></td>
                        </tr>
                        <tr>
                            <td>Telephone Number</td>
                            <td><input type="text" name="Telephone" /></td>
                        </tr>
                        <tr>
                            <td>Email</td>
                            <td><input type="text" name="Email" /></td>
                        </tr>
                        
                    </table>

                    <p><center><h1>Opening Hours</h1></center></p>
                    <table align="center">
                        <tr>
                            <th>Day</th>
                            <th>Open</th>
                            <th>Close</th>
                        </tr>
                        <tr>
                            <td>Monday*</td>
                            <td><input type="text" name="OpenMon" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseMon" placeholder="00:00" /></td>
                        </tr>
                        <tr>
                            <td>Tuesday*</td>
                            <td><input type="text" name="OpenTue" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseTue" placeholder="00:00" required /></td>
                        </tr>
                        <tr>
                            <td>Wednesday*</td>
                            <td><input type="text" name="OpenWed" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseWed" placeholder="00:00" required /></td>
                        </tr>
                        <tr>
                            <td>Thursday*</td>
                            <td><input type="text" name="OpenThu" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseThu" placeholder="00:00" required /></td>
                        </tr>
                        <tr>
                            <td>Friday*</td>
                            <td><input type="text" name="OpenFri" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseFri" placeholder="00:00" required /></td>
                        </tr>
                        <tr>
                            <td>Saturday*</td>
                            <td><input type="text" name="OpenSat" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseSat" placeholder="00:00" required /></td>
                        </tr>
                        <tr>
                            <td>Sunday*</td>
                            <td><input type="text" name="OpenSun" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseSun" placeholder="00:00" required /></td>
                        </tr>
                    </table>
                    <h1><center><p>Additional Details</p></center></h1>

                    <table align="center">
                        <tr>
                            <td>Members Only?*</td>
                            <td><input type="text" name="MembersOnly" required /></td>
                        </tr>
                        <tr>
                            <td>Number of English Pool Tables*</td>
                            <td><input type="text" name="EnglishTables" required /></td>
                        </tr>
                        <tr>
                            <td>Number of 9 Ball Tables*</td>
                            <td><input type="text" name="9BallTables" required /></td>
                        <tr>
                            <td>Number of Snooker Tables*</td>
                            <td><input type="text" name="SnookerTables" required /></td>
                        </tr>
                        <tr>
                            <td>English Table Rates (hour)*</td>
                            <td><input type="text" name="EnglishTableRates" required /></td>
                        </tr>
                        <tr>
                            <td>9 Ball Table Rates?*</td>
                            <td><input type="text" name="9BallTableRates" required /></td>
                        </tr>
                        <tr>
                            <td>SNooker Table Rates*</td>
                            <td><input type="text" name="Snooker Table Rates" required /></td>
                        </tr>
                        <tr>
                            <td>Number Of Team World Rules Pool?*</td>
                            <td><input type="text" name="NoTeamsPoolWorld" required /></td>
                        </tr>
                        <tr>
                            <td>Number of Teams 9 Ball?*</td>
                            <td><input type="text" name="NoTeams9Ball" required /></td>
                        </tr>
                        <tr>
                            <td>Number of Teams Snooker?*</td>
                            <td><input type="text" name="NoTeamsSnooker" required /></td>
                        </tr>
                        <tr>
                            <td>About?*</td>
                            <td><input type="text" name="About" required /></td>
                        </tr>
                        <tr>
                            <td>Food?*</td>
                            <td><input type="text" name="Food" required /></td>
                        </tr>
                        <tr>
                            <td>TV? </td>
                            <td><input type="text" name="TV" />
                            <td>
                        </tr>
                        <tr>
                            <td>Licenced Bar?</td>
                            <td><input type="text" name="LicencedBar" /></td>
                        </tr>
                        <tr>
                            <td>Image?</td>
                            <td><input type="text" name="Image" /></td>
                        </tr>
                        <tr>
                            <td>Image 2?</td>
                            <td><input type="text" name="Image2" /></td>
                        </tr>
                        <tr>
                            <td>Image 3?</td>
                            <td><input type="text" name="Image3" /></td>
                        </tr>
                        <tr>
                            <td>Image 4?</td>
                            <td><input type="text" name="Image4" /></td>
                        </tr>
                        <tr>
                            <td>Image 5?</td>
                            <td><input type="text" name="Image5" /></td>
                        </tr>
                        <tr>
                            <td>Image 6?</td>
                            <td><input type="text" name="Image6" /></td>
                        </tr>




                    </table>

                    <center><input type="submit" value="Submit" /></center>
                    <p>By Clicking 'Submit' you are agreeing for all the information you have provided to be used by PoolHQ.co.uk.</p>
            </form></b>
            
        </div>
    </div>
</div>
</div>


<?php
include("../includes/footer.php");
?>



The Table Structure is as follows

	#	Name	  Type	        Collation	Attributes	Null	Default	Extra	Action
	1	id	  bigint(20)			No 	None	AUTO_INCREMENT	Change Change	Drop Drop	
	2	Name	  varchar(50)	utf8_general_ci		No 	None		Change Change	Drop Drop	
    	3	Address1  varchar(50)	utf8_general_ci		No 	None		Change Change	Drop Drop	
	4	Address2  varchar(50)	utf8_general_ci		No 	None		Change Change	Drop Drop	
	5	Town	  varchar(50)	utf8_general_ci		No 	None		Change Change	Drop Drop	
	6	County	  varchar(50)	utf8_general_ci		No 	None		Change Change	Drop Drop	
	7	Country	  varchar(50)	utf8_general_ci		No 	None		Change Change	Drop Drop	
	8	Postcode  varchar(50)	utf8_general_ci		No 	None		Change Change	Drop Drop	
	9	Website	  varchar(50)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	10	Telephone varchar(20)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	11	Email	  varchar(50)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	12	OpenMon	  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	13	CloseMon  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	14	OpenTue	  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	15	CloseTue  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	16	OpenWed	  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	17	CloseWed  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	18	OpenThu	  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	19	CloseThu  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	20	OpenFri	  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	21	CloseFri  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	22	OpenSat	  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	23	CloseSat  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	24	OpenSun	  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	25	CloseSun  varchar(5)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	26	MembersOnly	bit(1)			No 	None		Change Change	Drop Drop	
	27	EnglishTables	int(3)			No 	None		Change Change	Drop Drop	
	28	9BallTables	int(3)			No 	None		Change Change	Drop Drop	
	29	SnookerTables	int(3)			No 	None		Change Change	Drop Drop	
	30	EnglishTableRates	decimal(10,0)			No 	None		Change Change	Drop Drop	
	31	9BallTableRates	decimal(10,0)			No 	None		Change Change	Drop Drop	
	32	SnookerTableRates	decimal(10,0)			No 	None		Change Change	Drop Drop	
	33	NoTeamsPoolWorld	int(3)			No 	None		Change Change	Drop Drop	
	34	NoTeams9Ball	int(3)			No 	None		Change Change	Drop Drop	
	35	NoTeamsBlackball	int(3)			No 	None		Change Change	Drop Drop	
	36	NoTeamsSnooker	int(3)			No 	None		Change Change	Drop Drop	
	37	Latitude	decimal(10,0)			No 	None		Change Change	Drop Drop	
	38	Longitude	decimal(10,0)			No 	None		Change Change	Drop Drop	
	39	About	varchar(200)	utf8_general_ci		No 	None		Change Change	Drop Drop	
	40	Food	bit(1)			No 	None		Change Change	Drop Drop	
	41	TV	varchar(50)	utf8_general_ci		No 	None		Change Change	Drop Drop	
	42	LicencedBar	bit(1)			No 	None		Change Change	Drop Drop	
	43	Image	varchar(50)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	44	Image2	varchar(50)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	45	Image3	varchar(50)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	46	Image4	varchar(50)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	47	Image5	varchar(50)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	
	48	Image6	varchar(50)	utf8_general_ci		Yes 	NULL		Change Change	Drop Drop	

   
Link to comment
Share on other sites

Well spotted, Thanks Barand and Jacques for your Eagle Eyes :)

 

The fun keeps coming though unfortunately, I have amended what has been spotted but the info is still not posting into the Table and I am still getting teh following error

 

"#1136 - Column count doesn't match value count at row 1" .....

You say you have amended the changes Barand and Jacques mentioned. Why does the code you posted above not show these changes?

Link to comment
Share on other sites

Apologies,

<?php
include("../includes/header.php");
?>
<div class="container">

<?php 

                                                 		
	if (strlen($_POST["Name"]) > 0)
	{
		//echo $Name;
		// INSERT 
			
	
		$Name = mysql_real_escape_string($_POST["Name"]);
		$Address1 = mysql_real_escape_string($_POST["Address1"]);
		$Address2 = mysql_real_escape_string($_POST["Address2"]);
		$Town = mysql_real_escape_string($_POST["Town"]);
		$County = mysql_real_escape_string($_POST["County"]);
		$Country = mysql_real_escape_string($_POST["Country"]);
		$Postcode = mysql_real_escape_string($_POST["Postcode"]);
		$Website = mysql_real_escape_string($_POST["Website"]);
		$Telephone = mysql_real_escape_string($_POST["Telephone"]);
		$Email = mysql_real_escape_string($_POST["Email"]);
		$OpenMon = mysql_real_escape_string($_POST["OpenMon"]);
		$CloseMon = mysql_real_escape_string($_POST["CloseMon"]);
		$OpenTue = mysql_real_escape_string($_POST["OpenTue"]);
		$CloseTue = mysql_real_escape_string($_POST["CloseTue"]);
		$OpenWed = mysql_real_escape_string($_POST["OpenWed"]);
		$CloseWed = mysql_real_escape_string($_POST["CloseWed"]);
		$OpenThu = mysql_real_escape_string($_POST["OpenThu"]);
		$CloseThu = mysql_real_escape_string($_POST["CloseThu"]);
		$OpenFri = mysql_real_escape_string($_POST["OpenFri"]);
		$CloseFri = mysql_real_escape_string($_POST["CloseFri"]);
		$OpenSat = mysql_real_escape_string($_POST["OpenSat"]);
		$CloseSat = mysql_real_escape_string($_POST["CloseSat"]);
		$OpenSun = mysql_real_escape_string($_POST["OpenSun"]);
		$CloseSun = mysql_real_escape_string($_POST["CloseSun"]);
		$MembersOnly = mysql_real_escape_string($_POST["MembersOnly"]);
		$EnglishTables = mysql_real_escape_string($_POST["EnglishTables"]);
		$NineBallTables = mysql_real_escape_string($_POST["9BallTables"]);
		$SnookerTables = mysql_real_escape_string($_POST["SnookerTables"]);
		$EnglishTableRates = mysql_real_escape_string($_POST["EnglishTableRates"]);
		$NineBallTableRates = mysql_real_escape_string($_POST["9BallTableRates"]);
		$SnookerTableRates = mysql_real_escape_string($_POST["SnookerTableRates"]);
		$NoTeamsPoolWorld = mysql_real_escape_string($_POST["NoTeamsPoolWorld"]);
		$NoTeams9Ball = mysql_real_escape_string($_POST["NoTeams9Ball"]);
		$NoTeamsBlackball = mysql_real_escape_string($_POST["NoTeamsBlackball"]);
		$NoTeamsSnooker = mysql_real_escape_string($_POST["NoTeamsSnooker"]);
		$Latitude = mysql_real_escape_string($_POST["Latitude"]);
		$Longitude = mysql_real_escape_string($_POST["Longitude"]);
		$About = mysql_real_escape_string($_POST["About"]);
		$Food = mysql_real_escape_string($_POST["Food"]);
		$TV = mysql_real_escape_string($_POST["TV"]);
		$LicencedBar = mysql_real_escape_string($_POST["LicencedBar"]);
		$Image = mysql_real_escape_string($_POST["Image"]);
		$Image2 = mysql_real_escape_string($_POST["Image2"]);
		$Image3 = mysql_real_escape_string($_POST["Image3"]);
		$Image4 = mysql_real_escape_string($_POST["Image4"]);
		$Image5 = mysql_real_escape_string($_POST["Image5"]);
		$Image6 = mysql_real_escape_string($_POST["Image6"]);                              
	 
	  $mysql = 'INSERT INTO Venues(Name, Address1, Address2, Town, County, Country, Postcode, Website, Telephone, Email, OpenMon, CloseMon, OpenTue, CloseTue, OpenWed, CloseWed, OpenThu, CloseThu, OpenFri, CloseFri, OpenSat, CloseSat, OpenSun, CloseSun, MembersOnly, EnglishTables, 9BallTables, SnookerTables, EnglishTableRates, 9BallTableRates, SnookerTableRates, NoTeamsPoolWorld, NoTeams9Ball, NoTeamsBlackball, NoTeamsSnooker, Latitude, Longitude, About, Food, TV, LicencedBar, Image, Image2, Image3, Image4, Image5, Image6) 
	  
	  VALUES (
	  "'.$Name.'", 
	  "'.$Address1.'", 
	  "'.$Address2.'", 
	  "'.$Town.'", 
	  "'.$County.'", 
	  "'.$Country.'", 
	  "'.$Postcode.'", 
	  "'.$Website.'", 
	  "'.$Telephone.'", 
	  "'.$Email.'", 
	  "'.$OpenMon.'", 
	  "'.$CloseMon.'", 
	  "'.$OpenTue.'", 
	  "'.$CloseTue.'", 
	  "'.$OpenWed.'", 
	  "'.$CloseWed.'", 
	  "'.$OpenThu.'", 
	  "'.$CloseThu.'", 
	  "'.$OpenFri.'", 
	  "'.$CloseFri.'", 
	  "'.$OpenSat.'", 
	  "'.$CloseSat.'", 
	  "'.$OpenSun.'", 
	  "'.$CloseSun.'", 
	  "'.$MembersOnly.'", 
	  "'.$EnglishTables.'", 
	  "'.$NineBallTables.'", 
	  "'.$SnookerTables.'", 
	  "'.$EnglishTableRates.'", 
	  "'.$NineBallTableRates.'", 
	  "'.$SnookerTableRates.'", 
	  "'.$NoTeamsPoolWorld.'", 
	  "'.$NoTeams9Ball.'", 
	  "'.$NoTeamsBlackball.'", 
	  "'.$NoTeamsSnooker.'", 
	  "'.$Latitude.'", 
	  "'.$Longitude.'", 
	  "'.$About.'", 
	  "'.$Food.'", 
	  "'.$TV.'", 
	  "'.$LicencedBar.'", 
	  "'.$Image.'", 
	  "'.$Image2.'", 
	  "'.$Image3.'", 
	  "'.$Image4.'", 
	  "'.$Image5.'", 
	  "'.$Image6.'"';)
	  
	  echo $mysql;

		// excecute the SQL on MySQL
	  $result =	mysql_query($mysql);	
	  
	  echo $result;
	}
?>

<!--STart of Old Add

    }
}
End of add-->


<div class="row" id="features">
    <div class="col-sm-12 feature">
        <div class="panel">
            <form method="post">
                <center><h1><u>Venue Setup Form</u></h1></center>

                <p>
                    <input type="hidden" id="Latitude" name="Latitude" value="50.992376" placeholder="Latitude" step="any" style="width: 48%" />
                    <input type="hidden" id="Longitude" name="Longitude" value="50.992376" placeholder="Longitude" step="any" style="width: 48%" />
                </p>

                <p>
                    <b>
                        Please fill out the form below as acurately as possible. Remember, All the details that are entered here will be
                        available for others to view when searching PoolHQ for Leagues.
                    </b>
                </p>

                <p><font style="color: red;"><b>Fields marked * are required</b></p></font>
                <b>
                    <table align="center">
                        <tr>
                            <td>Venue Name*</td>
                            <td><input type="text" name="Name" required /></td>
                        </tr>
                        <tr>
                            <td>Address*</td>
                            <td><input type="text" name="Address1" required /></td>
                        </tr>
                        <tr>
                            <td>Address</td>
                            <td><input type="text" name="Address2" /></td>
                        </tr>
                        <tr>
                            <td>Town</td>
                            <td><input type="text" name="Town" /></td>
                        </tr>
                        <tr>
                            <td>County</td>
                            <td><input type="text" name="County" required /></td>
                        </tr>
                        <tr>
                            <td>Country*</td>
                            <td><input type="text" name="Country" required /></td>
                        </tr>
                        <tr>
                            <td>Postcode</td>
                            <td><input type="text" id="PostCode" name="PostCode" required onChange="updateLatitudeLongitude()" /></td>
                        </tr>
                        <tr>
                            <td>Website*</td>
                            <td><input type="text" name="Website" required/></td>
                        </tr>
                        <tr>
                            <td>Telephone Number</td>
                            <td><input type="text" name="Telephone" /></td>
                        </tr>
                        <tr>
                            <td>Email</td>
                            <td><input type="text" name="Email" /></td>
                        </tr>
                        
                    </table>

                    <p><center><h1>Opening Hours</h1></center></p>
                    <table align="center">
                        <tr>
                            <th>Day</th>
                            <th>Open</th>
                            <th>Close</th>
                        </tr>
                        <tr>
                            <td>Monday*</td>
                            <td><input type="text" name="OpenMon" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseMon" placeholder="00:00" /></td>
                        </tr>
                        <tr>
                            <td>Tuesday*</td>
                            <td><input type="text" name="OpenTue" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseTue" placeholder="00:00" required /></td>
                        </tr>
                        <tr>
                            <td>Wednesday*</td>
                            <td><input type="text" name="OpenWed" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseWed" placeholder="00:00" required /></td>
                        </tr>
                        <tr>
                            <td>Thursday*</td>
                            <td><input type="text" name="OpenThu" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseThu" placeholder="00:00" required /></td>
                        </tr>
                        <tr>
                            <td>Friday*</td>
                            <td><input type="text" name="OpenFri" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseFri" placeholder="00:00" required /></td>
                        </tr>
                        <tr>
                            <td>Saturday*</td>
                            <td><input type="text" name="OpenSat" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseSat" placeholder="00:00" required /></td>
                        </tr>
                        <tr>
                            <td>Sunday*</td>
                            <td><input type="text" name="OpenSun" placeholder="09:00" required /></td>
                            <td><input type="text" name="CloseSun" placeholder="00:00" required /></td>
                        </tr>
                    </table>
                    <h1><center><p>Additional Details</p></center></h1>

                    <table align="center">
                        <tr>
                            <td>Members Only?*</td>
                            <td><input type="text" name="MembersOnly" required /></td>
                        </tr>
                        <tr>
                            <td>Number of English Pool Tables*</td>
                            <td><input type="text" name="EnglishTables" required /></td>
                        </tr>
                        <tr>
                            <td>Number of 9 Ball Tables*</td>
                            <td><input type="text" name="9BallTables" required /></td>
                        <tr>
                            <td>Number of Snooker Tables*</td>
                            <td><input type="text" name="SnookerTables" required /></td>
                        </tr>
                        <tr>
                            <td>English Table Rates (hour)*</td>
                            <td><input type="text" name="EnglishTableRates" required /></td>
                        </tr>
                        <tr>
                            <td>9 Ball Table Rates?*</td>
                            <td><input type="text" name="9BallTableRates" required /></td>
                        </tr>
                        <tr>
                            <td>SNooker Table Rates*</td>
                            <td><input type="text" name="Snooker Table Rates" required /></td>
                        </tr>
                        <tr>
                            <td>Number Of Team World Rules Pool?*</td>
                            <td><input type="text" name="NoTeamsPoolWorld" required /></td>
                        </tr>
                        <tr>
                            <td>Number of Teams 9 Ball?*</td>
                            <td><input type="text" name="NoTeams9Ball" required /></td>
                        </tr>
                        <tr>
                            <td>Number of Teams Snooker?*</td>
                            <td><input type="text" name="NoTeamsSnooker" required /></td>
                        </tr>
                        <tr>
                            <td>About?*</td>
                            <td><input type="text" name="About" required /></td>
                        </tr>
                        <tr>
                            <td>Food?*</td>
                            <td><input type="text" name="Food" required /></td>
                        </tr>
                        <tr>
                            <td>TV? </td>
                            <td><input type="text" name="TV" />
                            <td>
                        </tr>
                        <tr>
                            <td>Licenced Bar?</td>
                            <td><input type="text" name="LicencedBar" /></td>
                        </tr>
                        <tr>
                            <td>Image?</td>
                            <td><input type="text" name="Image" /></td>
                        </tr>
                        <tr>
                            <td>Image 2?</td>
                            <td><input type="text" name="Image2" /></td>
                        </tr>
                        <tr>
                            <td>Image 3?</td>
                            <td><input type="text" name="Image3" /></td>
                        </tr>
                        <tr>
                            <td>Image 4?</td>
                            <td><input type="text" name="Image4" /></td>
                        </tr>
                        <tr>
                            <td>Image 5?</td>
                            <td><input type="text" name="Image5" /></td>
                        </tr>
                        <tr>
                            <td>Image 6?</td>
                            <td><input type="text" name="Image6" /></td>
                        </tr>




                    </table>

                    <center><input type="submit" value="Submit" /></center>
                    <p>By Clicking 'Submit' you are agreeing for all the information you have provided to be used by PoolHQ.co.uk.</p>
            </form></b>
            
        </div>
    </div>
</div>
</div>


<?php
include("../includes/footer.php");
?>



Link to comment
Share on other sites

Ch0cu3r,

 

Thanks very ,much for your input on this, it has worked like a dream.

 

Apologies for it being an easy one for you hardened pro's but like I said I am a bit new to this and I just need a kick in the right direction (which you have done) so thanks again!

Link to comment
Share on other sites

Next time try reversing your use of quotes. Since php recognized any php var that is wrapped in double quotes on the outer side you could have started the query statement with a " and then not have to concatenate all of your vars in the values.

 

Ex.

 

$q = "insert into table (field1, field2, field3)

values ('$value1', '$value2', '$value3')";

 

Much simpler to code and read and works the same as your more complex string.

Edited by ginerjm
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.