Skip to content

Instantly share code, notes, and snippets.

@flexd
Created February 10, 2012 10:20
Show Gist options
  • Save flexd/1788534 to your computer and use it in GitHub Desktop.
Save flexd/1788534 to your computer and use it in GitHub Desktop.
<?php
mysql_connect("localhost","kristoffer","dbpass") or die("Kan ikke koble til server");
mysql_select_db("kristoffer")or die("Kan ikke koble til databasen");
$deptno=trim($_POST ["DEPTNO"]);
$dname=trim($_POST ["DNAME"]);
$loc=trim($_POST ["LOC"]);
$sql="INSERT INTO DEPT (DEPTNO, DNAME, LOC) VALUES ('$deptno','$dname','$loc')";
$resultat=mysql_query($sql);
header("Location:meny.html");
exit();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment