Thanks for the format...
I 'm just a beginner with PHP and mySQL. Presently practicing with XAMPP v5.6.8(PHP v5.6.8). I use drop down lists to select the month and year in a html form like the the coding below:
In "XXXX.php"
Code:
<html>
<head><title>Sales Commission </title>
</head>
<body>
...
<p>Month :
<input type="month" name="Month">
<select name = "Month">
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
</select>
similarly a dropdown list for the "year" with a
Code:
<form action='<?php $_SERVER['PHP_SELF'] ?>' method="POST">
<input type="submit" name="submit" value="Submit">
and then the php code in the same page
PHP Code:
<?php
// Connect to database server
mysql_connect("localhost", "username", " ") or die (mysql_error ());
// Select database
mysql_select_db("mydatabase") or die(mysql_error());
// receive the variables using the POST method
$a=$_POST['Month'];
$b=$_POST['year'];
// The SQL statement is built
$strSQL = "INSERT INTO salesdata(Month, year) VALUES ('$a', '$b')";
";
// The SQL statement is executed
mysql_query($strSQL) or die (mysql_error());
// Close the database connection
mysql_close();
?>
But if I use the calendar script from a website
Script name : Dynamic Calendar
http://www.dynamicdrive.com/dynamicindex6/dcalendar.htm
when user selects a month or year in the form, how to receive data in php and insert it into the database
How to store it in a mysql database in XAMPP? or in anyother database... Any suggestions on how to learn advanced stuffs in PHP.. books? websites?
Hope I'm clear...
Thanks
Bookmarks