hey,I am a newbie learner,this might sound a stupid question but yes,what datatype to choose for data format.
I googled it,but disappointed to get no answer,usually the date datatype ranges from 0001-01-01 through 9999-12-31,and it is in numeric form,
in my contact form,I have a jquery datepicker,when user selects the date,the value displayed on the textbox is like this "March 13th, 2013" ,I am wondering what datatype to use.
and for time,in the format "14:20" what datatype to use?
the code of my form is ~
<?php include 'process-form.php'; ?>
<div class="wrapper clearfix">
<div id="contact-wrapper" class="clearfix">
<div class="form-wrapper clearfix">
<div class="message">
<?php echo !empty($error_list) ? $error_list : ''; ?>
</div>
<form name="contact-form" id="contact-form" action="database.php" method="post">
<fieldset>
<div class="field">
<label for="name">Name</label>
<input type="text" id="name" name="name" autofocus required="required">
</div>
<div class="field">
<label for="email">Email</label>
<input type="email" id="email" name="email">
</div>
<div class="field">
<label for="phone">Phone</label>
<input type="text" id="phone" name="phone" required="required">
</div>
<div class="field">
<label for="time">Time</label>
<input type="text" style="width: 70px;" id="timepicker.[1]" value="" />
<script type="text/javascript">
$(document).ready(function() {
$('#timepicker\\.\\[1\\]').timepicker( {
showAnim: 'blind'
} );
});
</script>
</div>
<div class="field">
<label for="date">Date</label>
<input id="datepick" />
</div>
<div class="field">
<label for="trip_type">Trip type</label>
<select id="trip_type" name="trip_type" required="required">
<option>Point to Point</option>
<option>Round trip</option>
<option>Other</option>
</select>
</div>
<div class="field">
<label for="pickup">Pickup location</label>
<input type="text" id="pickup" name="pickup" required="required">
</div>
<div class="field">
<label for="destination">Destination</label>
<input type="text" id="destination" name="destination" required="required">
</select>
</div>
<div class="field">
<label for="message">Message</label>
<textarea id="message" name="message"></textarea>
</div>
<div class="field submit">
<input type="submit" value="Submit"/>
</div>
</fieldset>
</form>
For better view,I posted it on pastebin:
1)the form
2)process-form.php
These form script was taken from some site,I just modified it,it usually emails the contents,but I want all these form details to save on a database.
please help me with this.
I want the whole database query code which is to be run to make tables and fields for the name,address etc.
and the php code ,the database.php code which will make it possible to save data on the db.
Thanks a ton,please help me.
If there is a website offering some GUI service or any other way to generate the MySQL code easily,please do post,and suggest any good website or free eBook by which I could learn MySQL.
I googled it,but disappointed to get no answer,usually the date datatype ranges from 0001-01-01 through 9999-12-31,and it is in numeric form,
in my contact form,I have a jquery datepicker,when user selects the date,the value displayed on the textbox is like this "March 13th, 2013" ,I am wondering what datatype to use.
and for time,in the format "14:20" what datatype to use?
the code of my form is ~
<?php include 'process-form.php'; ?>
<div class="wrapper clearfix">
<div id="contact-wrapper" class="clearfix">
<div class="form-wrapper clearfix">
<div class="message">
<?php echo !empty($error_list) ? $error_list : ''; ?>
</div>
<form name="contact-form" id="contact-form" action="database.php" method="post">
<fieldset>
<div class="field">
<label for="name">Name</label>
<input type="text" id="name" name="name" autofocus required="required">
</div>
<div class="field">
<label for="email">Email</label>
<input type="email" id="email" name="email">
</div>
<div class="field">
<label for="phone">Phone</label>
<input type="text" id="phone" name="phone" required="required">
</div>
<div class="field">
<label for="time">Time</label>
<input type="text" style="width: 70px;" id="timepicker.[1]" value="" />
<script type="text/javascript">
$(document).ready(function() {
$('#timepicker\\.\\[1\\]').timepicker( {
showAnim: 'blind'
} );
});
</script>
</div>
<div class="field">
<label for="date">Date</label>
<input id="datepick" />
</div>
<div class="field">
<label for="trip_type">Trip type</label>
<select id="trip_type" name="trip_type" required="required">
<option>Point to Point</option>
<option>Round trip</option>
<option>Other</option>
</select>
</div>
<div class="field">
<label for="pickup">Pickup location</label>
<input type="text" id="pickup" name="pickup" required="required">
</div>
<div class="field">
<label for="destination">Destination</label>
<input type="text" id="destination" name="destination" required="required">
</select>
</div>
<div class="field">
<label for="message">Message</label>
<textarea id="message" name="message"></textarea>
</div>
<div class="field submit">
<input type="submit" value="Submit"/>
</div>
</fieldset>
</form>
For better view,I posted it on pastebin:
1)the form
2)process-form.php
These form script was taken from some site,I just modified it,it usually emails the contents,but I want all these form details to save on a database.
please help me with this.
I want the whole database query code which is to be run to make tables and fields for the name,address etc.
and the php code ,the database.php code which will make it possible to save data on the db.
Thanks a ton,please help me.
If there is a website offering some GUI service or any other way to generate the MySQL code easily,please do post,and suggest any good website or free eBook by which I could learn MySQL.