Re: [PHP] PHP Insert Data Form

2003-01-01 Thread Michael J. Pawlowsky


Here's what I suggest.  go to http://www.vtwebwizard.com/tutorials/mysql/

This guys has a really nice tutorial along with a nice class for MySQL that makes 
inserting data nice and easy.

Cheers,
Mike







*** REPLY SEPARATOR  ***

On 01/01/2003 at 11:35 PM Edson Waite wrote:

>Hi All,
>
>Hope everyone had a safe and happy New Year, I am still having trouble
>getting an insert data form to work. Below is the code. I was also
>wondering
>if anyone could tell me the PHP Configuration settings necessary to allow a
>form to insert data into a MySQL database.
>
>To view this page, http://www.airforcemuseum.com/newentry.htm
>
>
>Thanks in advance,
>Ed Waite




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP Insert Data Form

2003-01-01 Thread Edson Waite
Hi All,

Hope everyone had a safe and happy New Year, I am still having trouble
getting an insert data form to work. Below is the code. I was also wondering
if anyone could tell me the PHP Configuration settings necessary to allow a
form to insert data into a MySQL database.

To view this page, http://www.airforcemuseum.com/newentry.htm




Test Form Entry Results




Entry Results
"
  ."Please go back and try again.";
 exit;
}

$firstName = addslashes($firstName);
$lastName = addslashes($lastName);

$dbcnx = @mysql_pconnect("localhost", "username", "password");

if ($db)
{
 echo "ERROR: Could not connect to database. Please try again later,";
 exit;
}
mysql_select_db("testform");
$query = "insert into testform values
  ('".$firstName."', '".$lastName."')";
$result = mysql_query($query);
if ($result)
 echo  mysql_affected_rows()." record inserted into database.";
?>




Thanks in advance,
Ed Waite




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php