Forum Moderators: coopster
I also want to konw how insert into table works in php with MS Access as database.I have a form which as a link to database through a second php scrpit.I tried to inert a row into my table,but am not successful.the code is
Form.php
<?php
echo "
<HTML><HEAD>
<TITLE>Processing Form</TITLE>
</HEAD>
<BODY BGCOLOR=\"#D5D5AB\">
</body></html>";
echo "
<FORM NAME = \"AccessInterface\" METHOD=post ACTION=\"Data2.php\">
Please enter the details you wish to be inserted
into the Access Database data2.<br>
First Name:<input name=\"FirstName\" TYPE=\"text\" SIZE=\"25\"><br>
<INPUT type=\"Submit\" name=\"Sumbit\">
</form>
";
?>
The form acts on Data2.php which is
<?php
echo"<HTML>
<HEAD>
<TITLE>Processing Form</TITLE>
</HEAD>
<BODY>
</body>
</html>";
$cnx = odbc_connect( 'Test' , '', '' );
echo"connected";
if (!$cnx) {
Error_handler( "Error in odbc_connectnn", $cnx );
}
$SQL_Exec_String = "Insert Into People1 Values ('$FirstName')" ;
$cur= odbc_exec( $cnx, $SQL_Exec_String );
echo "Thank you! Information entered.\n";
if (!$cur) {
Error_handler( "Error in odbc_exec( no cursor returned mm) " , $cnx );
odbc_close( $cnx);
}
?>
I get the Warning message that FirstName variable is undefined and error as people1.FirstName can not be a zero length string.
Please help...I am stuck
Which OS are you trying to install it on? And, if a linux/unix system, are you looking for RPM or step by step instructions?
Regardless, all the installation information can be found on [mysql.com...]
Just download the MySQL installation files (along with instructions) from the MySQL website.
[dev.mysql.com...]
<html>
<body>
<?php
if ($submit) {
// process form
$db = mysql_connect("localhost", "root");
mysql_select_db("Test",$db);
$sql = "INSERT INTO People1 (FirstName) VALUES ('$FirstName')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
// display form
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']?>">
First name:<input type="Text" name="FirstName">
<input type="Submit" name="submit" value="Enter information">
</form>
<?php
but getting the following error...please help
Forbidden
You don't have permission to access /<br /><b>Notice</b>: Undefined variable: PHP_SELF in <b>c:/program files/easyphp1-8/www/test.php</b> on line <b>37</b><br /> on this server.
--------------------------------------------------------------------------------
Apache/1.3.33 Server at 127.0.0.1 Port 80
I have MySQL loaded independently from [mysql.net...]
I dont know which MySQL is needed?
The directory is
C:\Program Files\EasyPHP1-8\MySQL
Size of MySQL is 85.4MB
I also have
C:\Program Files\EasyPHP1-8\www\MySQL
size of MySQL is 57.5MB
From http:/www.mysql.com what do I need-
source downloads or MySQL 4.1 downloads.
I am asking these simple questions again
1. How to configure /run MySQL?
2.Do I need to set up TCP/IP also? if yes how?
3.I get mysql when i download easyphp together with Apache.Is this mysql same as what we get from the website www.mysql.com