|
Posted by J.O. Aho on 07/24/05 17:03
Luigi Donatello Asero wrote:
> In the example below I have only written the html body to try to reduce the
> code to a minimum and find the error.
>
> <?php
> if(isset($_POST['add']));
> $fornamn = $_POST['fornamn'];
> $efternamn = $_POST['efternamn'];
> $db = mysql_connect("local host", "user",
> "password");
> mysql_select_db("scaiecat_?", $db);
> $query = "INSERT INTO Formulär ('local host', 'user',
> 'password');
Avoid to use åäö in table and column names, those leads usually to problems.
> VALUES ('förnamn' ( '$fornamn'), efternamn('$efternamn')";
> mysql_query($query) or die('Error, insert query failed'};
> else {
A query should look something like:
$query="INSERT INTO Formular('fornamn','efternamn')
VALUES($fornamn','$efternamn')";
See the MySQL manual http://dev.mysql.com/doc/mysql/en/insert.html
//Aho
[Back to original message]
|