MySQL Forums
Forum List  »  Newbie

Form to database, not getting any records
Posted by: gaute
Date: July 22, 2005 03:23AM

Hi

I am trying to parse a HTML form into a MySQL database.
But when i submit it, no records show up in the database.
It is a simple script so far, just wanted it to get up and running, I'll try to expand it later.

The HTML form is too big to copy in here.
My PHP Script looks like this:

<?
$DBhost = "x";
$DBuser = "x";
$DBpass = "x";
$DBName = "x";
$table = "Evaluering";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Kan ikke koble til databasen");

@mysql_select_db("$DBName") or die("Finner ikke databasen $DBName");

$sqlquery = "INSERT INTO $table
(KundeNr,Navn,Epost,Bedrift,Prosjekt,S1,S2,S3,S4,S5,S6,S7,S8,S9,S10,S11,S12,S13,S14,
Kontakt,Annerledes,KundeAnnerledes,Andre)
VALUES( '$KundeNr',
'$Navn',
'$Epost',
'$Bedrift',
'$Prosjekt',
'$S1',
'$S2',
'$S3',
'$S4',
'$S5',
'$S6',
'$S7',
'$S8',
'$S9',
'$S10',
'$S11',
'$S12',
'$S13',
'$S14',
'$Kontakt',
'$Annerledes',
'$KundeAnnerledes',
'$Andre',
)";

$results = mysql_query($sqlquery);

mysql_close();

print "<HTML><TITLE> PHP and MySQL </TITLE><BODY
BGCOLOR=\"#FFFFFF\"><center><table border=\"0\"
width=\"500\"><tr><td>";
print "<p><font face=\"verdana\" size=\"+0\"> <center>Disse dataene blir registrert:<p><blockquote>";
print "Navn : $Navn<p>
Epost : $Epost<p>
Bedrift : $Bedrift<p>
Prosjekt : $Prosjekt
</blockquote></td></tr></table>
</center></BODY></HTML>";
?>

Options: ReplyQuote


Subject
Written By
Posted
Form to database, not getting any records
July 22, 2005 03:23AM


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.