Hi NG
Now that I finally realy work with the combination mySQL & PHP on a
Windows-machine I began to just love it. There's only one problem I still
have:
How can I INSERT data from a HTML-form to the database on the server? I'd
like to have some kind of a GUI on the internet so I could administer and
manage the database from everywhere I want.
Please look at what I have yet. Maybe you can find the prob and help me. (I
have the idea that "mysql_query()" can't work with the variables ($uName &
$eMail).)
Thanx in advance,
Yours Nils.
---------------------------------------------------------
$con = @mysql_connect("host", "user", "password") or die("Oops... no
connect.");
$qry = "SELECT name, mail FROM TUsers";
$res = mysql_db_query("database", $qry, $con);
// $ins = "INSERT INTO TUsers (name, mail)
// VALUES ($uName, $eMail)"; // ---------------> doesn't work!
$ins = "INSERT INTO TUsers (name, mail)
VALUES (\"Any Name\", "\and eMail\"); // ------> works
perfect!
mysql_query($ins) or die("Sorry. Couldn't execute INSERT.");
<form action="script.php" method="post">
Name: <input type="text" name="uName"><br>
eMail: <input type="text" name="eMail"><br>
<input type="submit">
</form>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]