MySQL Forums
Forum List  »  PHP

inserting a new row with php
Posted by: Oli Par
Date: May 01, 2005 06:49PM

Hi all, thanks in advance for your help...

I created a database called mailing, with a table named girls [just for the test]
I'm only using two fields, name and email.

here is my htm form :

<?
else
{

?>
<form method="post" action="mailing.php">
<TABLE>
<TR>
<TD>Name:</TD>
<TD><INPUT TYPE='TEXT' NAME='name' VALUE='' size=60></TD>
</TR>
<TR>
<TD>Email:</TD>
<TD><INPUT TYPE='TEXT' NAME='email' VALUE='' size=60></TD>
</TR><br>
<TR>
<TD></TD><br>
<TD><INPUT TYPE="submit" name="submit" value="submit"></TD>
</TR>
</TABLE>
</form>

<?
}
?>

-------------------------------

here is the process page :

<?

if($_POST['submit'])
{
mysql_connect("localhost","root","****");

mysql_select_db("mailing");

$name = $_POST['name'];
$email = $_POST['email'];

$result=MYSQL_QUERY ("INSERT INTO girls (name,email)".
"VALUES ('$name', '$email')");

echo "Query Finished";
}
?>
----------------------------

When testing it, I get the echo Query finished, however, nothing was added to the table.

I using the latest version of mysql with the administrator and PHP5.

Any idea why ?

Thanks again

Options: ReplyQuote


Subject
Written By
Posted
inserting a new row with php
May 01, 2005 06:49PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.