mercredi 21 janvier 2015

checkboxes value clicked or not save to sql

I have a table made up of time slots, when the user clicks maybe one or two and presses submit, i would like the date selected and the time slots chosen to be saved in to my sql.


I am working on the query but a little stuck in regards to the query, i have done the following:



<?php
$username = "root";
$password = "";
$hostname = "localhost";


$dbhandle = mysql_connect($hostname, $username, $password) or die ("no
connection to database");


if(isset($_POST['Submit'])){

$start = mysql_real_escape_string($_POST['start']);
$end = mysql_real_escape_string($_POST['end']);
$booked = mysql_real_escape_string($_POST['booked']);

$selected = mysql_select_db("booking", $dbhandle);

?>


i have set the table as follows



<input data-val='08:30 - 08:45' class='fields' type='checkbox'
name="booked[]" />




Aucun commentaire:

Enregistrer un commentaire