Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Tuotteen poisto kannasta</title>
- </head>
- <body>
- <div align="center">
- <?php
- include("Header.php");
- $id = $_POST['id'];
- //Yhteys tietokantaan
- $type="mysql";
- $user="root";
- $pwd="";
- $host="localhost";
- $dbname="testikauppa";
- $link=mysql_connect($host, $user, $pwd);
- if (!$link){
- die('ei yhteyttä:' .mysql_error());
- }
- $poistettava = mysql_query('SELECT *FROM tuotteet WHERE id like $id');
- if($id == $poistettava){
- $sql = 'DELETE FROM tuotteet WHERE id=$id';
- echo "Tuote poistettu onnistuneesti";
- } else {
- die('Tuotetta ei voitu poistaa/virheellinen ID'. mysql_error());
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement