OK, I am new to PHP and MySQL, so bear with me. What I am trying to do is write a script in PHP to allow my members to file a flight report and have it added to our database for viewing by themselves and others. I have the database setup properly and can add records using the MySQL Administrator that comes with my site, but I cannot get this script to work. I get no errors, but the information is not recorded in the database.
Using MySQL 3.23.56 and PHP 4.2.2
The script.php looks like this:
<?php
$db = mysql_connect("localhost", "tddftegh","scarlet"
;
mysql_select_db("margaritaair_com",$db);
$sql = "INSERT INTO flightlog (macid, name, date, type, departure, destination, time, charterdoll, comment) VALUES ('$macid', '$name', '$date','$type','$departure','$destination','$time','$charterdoll','$comment')";
$result = mysql_query($sql);
if ($result) {
echo ("PIREP recorded successfully"
;
} else {
echo("An error has occurred"
;
}
MySQL_close()
?>
And the html form looks like this:
<HTML>
<HEAD>
<BODY background="sky01.jpg">
<TITLE>PIREP INPUT FORM</TITLE>
<form method="post" action="script.php">
MACID: <input type="text" name="macid"><br>
Name: <input type="text" name="name"><br>
Date of Flight: <input type="text" name="date"><br>
Type of Flight: <input type="text" name="type"><br>
Departure: <input type="text" name="departure"><br>
Destination: <input type="text" name="destination"><br>
Charter Pay: <input type="text" name="charterdoll"><br>
Comment: <input type="text" name="comment"><br>
<input type="submit" name="submit" value="SUBMIT ">
</form>
</html>
Again,I know this is basic stuff, but I cannot find out in any of my documentation why this is not working.
Thanks
Todd
Using MySQL 3.23.56 and PHP 4.2.2
The script.php looks like this:
<?php
$db = mysql_connect("localhost", "tddftegh","scarlet"

mysql_select_db("margaritaair_com",$db);
$sql = "INSERT INTO flightlog (macid, name, date, type, departure, destination, time, charterdoll, comment) VALUES ('$macid', '$name', '$date','$type','$departure','$destination','$time','$charterdoll','$comment')";
$result = mysql_query($sql);
if ($result) {
echo ("PIREP recorded successfully"

} else {
echo("An error has occurred"

}
MySQL_close()
?>
And the html form looks like this:
<HTML>
<HEAD>
<BODY background="sky01.jpg">
<TITLE>PIREP INPUT FORM</TITLE>
<form method="post" action="script.php">
MACID: <input type="text" name="macid"><br>
Name: <input type="text" name="name"><br>
Date of Flight: <input type="text" name="date"><br>
Type of Flight: <input type="text" name="type"><br>
Departure: <input type="text" name="departure"><br>
Destination: <input type="text" name="destination"><br>
Charter Pay: <input type="text" name="charterdoll"><br>
Comment: <input type="text" name="comment"><br>
<input type="submit" name="submit" value="SUBMIT ">
</form>
</html>
Again,I know this is basic stuff, but I cannot find out in any of my documentation why this is not working.
Thanks
Todd