I have a registration form, which gets data from a database and after user submitted the form data stores into another database.
Here you can see my form:

Date and time are data, which come from "datetime"table on "calendar" database. And I have put times as checkboxs and I want after being selected once, they become unselectables or unavailbles! Data will be stored on For this I have this code:
- Code: Select all
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("calendar", $con);
$result = mysql_query("SELECT * FROM datetime ORDER BY id DESC LIMIT 1");
while($row = mysql_fetch_array($result))
{
[b][i]// for each checkbox[/i][/b]
echo"
<div class='box'>
<div class='boxbut'>
if($_POST['datetime'] != ($row['day1'] . " " . $row['time1'])) {
echo"
<input type='radio' name='datetime' value='". $row['day1']." ".$row['time1']."' disabled>
<p>". $row['day1'] ,"</p><br/>". $row['time1'] ."
// etc
} else {
echo"
<input type='radio' name='datetime' value='". $row['day1']." ".$row['time1']."'>
<p>". $row['day1'] ,"</p><br/>". $row['time1'] ."
}
</div>
</div>";
This code is ok, but for making selected checkbox unavailble I have connect this form also to other table on other dabase, where data will be stored. My table name's for this is "students" on "college" database.
In the students I have also "datetime" row.
After I fill form and chose one checkbox and submit it, I got this error. Because form does'nt have connection to validate if data is already recorded:
datetime in C:\xampp\htdocs\form.php on line 98 and here is line 98
Question is how can I connect this form to those two database?


