Created
September 26, 2017 10:17
-
-
Save asathoor/3fe79d88f8f7d8b91ef8a99a6eafcbf8 to your computer and use it in GitHub Desktop.
Insert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* file: action.php | |
* purpose: INSERT INTO | |
**/ | |
$sql = "INSERT INTO `navne` (`navne_id`, `fornavn`, `efternavn`, `email`) VALUES (NULL, '" . $_GET['firstName'] . "', '".$_GET['lastName']."', '". $_GET['gender'] ."')"; | |
echo $sql; | |
require_once "db.php"; // database connect | |
if($_GET) { | |
// INSERT | |
if( $insert = $mysqli->query($sql) ){ | |
echo "<p>New actor added: $fn $ln - Gee thanx a lot.</p>"; | |
echo "<h2>SQL</h2> <pre>" . $sql ."</pre>"; | |
} else { | |
echo "INSERT not possible. Check your SQL."; | |
} | |
} | |
else { | |
echo "<p>Error: Use the form please. No GET got.</p>"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment