Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ((isset($_POST["marca"]))&&(isset($_POST["modelo"]))&&(isset($_POST["imagen"])))
- {
- $servername = "localhost";
- $username = "root";
- $password = "";
- $conn = mysqli_connect($servername, $username, $password, "coche");
- $sql = "INSERT INTO `coche`.`coche` (`marca`, `modelo`, `foto`) VALUES ('".$_POST["marca"]."', '".$_POST["modelo"]."', '".$_POST["imagen"]."')";
- if (mysqli_query($conn, $sql) === TRUE) {
- echo "</br>".$_POST["marca"]." ".$_POST["modelo"]." insertado correctamente";
- } else {
- echo "</br>Error: " . $conn->error;
- }
- }
- else
- echo "Porfavor usa el formulario";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement