Search the Community
Showing results for tags 'alter'.
-
<html> <head> <meta charset="iso-8859-1" /> <title> Hjem </title> </head> <body> <?php include 'config.php'; session_start(); if(!session_is_registered(mitbrugernavn)){ ?> <form action="tjek.php" method="post"> Brugernavn: <input type="text" name="mitbrugernavn"> </p> Kodeord: <input type="password" name="mitkodeord"> </p> <input type="submit" value="Login"> </form> <?php } else { ?> </p> Du er nu logget ind! Velkommen <? print $_SESSION['mitbrugernavn']; ?> </p> <li> <a href="logout.php"> Log ud </a> </li> </p> <li> <a href="opret.php"> Opret ny konto </a> </li> <li> <a href="medlemmer.php">Oprettede kontoer</a> </li> </p> <? $con = mysql_connect("localhost","HIDDEN","HIDDEN"); if (!$con) { die('Kunne ikke tilslutte: ' . mysql_error()); } mysql_select_db("HIDDEN", $con); $result = mysql_query("select count(*) FROM medlemmer"); $row = mysql_fetch_array($result); $total = $row[0]; echo "Antal medlemmer: " . $total; } ?> </p> </p> <?php $aktion= $_GET['action']; if($aktion == "slet"){ mysql_query("DELETE FROM news WHERE name=$nName"); echo "Nyheden er nu slettet"; echo ('<meta http-equiv="refresh" content="3;url=tilfoj-nyheder.php">'); } else { echo "Kunne ikke slette nyheden"; } $loadNews = mysql_query("SELECT * FROM news ORDER BY id DESC") or die(mysql_error()); if(mysql_num_rows($loadNews) == 0) { echo "Der er ikke blevet tilføjet nogle nyheder."; } else { while($showNews = mysql_fetch_array($loadNews)) { $nName = stripslashes($showNews["name"]); $nAuthor = stripslashes($showNews["author"]); $nText = nl2br(stripslashes($showNews["text"])); $nDate = $showNews["date"]; ?> <div> <div align="center" style="border-style:solid; margin:3px; width:400px; height:auto;"> <b> <?php print "$nName"; ?> </b><br /> <i>Skrevet af <? print "$nAuthor ,"; ?> d. <?php print "$nDate"; ?> </i><br /> <? print "$nText"; ?> <br /><br /> </div> </br> <? if(session_is_registered(mitbrugernavn)){ ?> <form action='?action=slet' method="POST"> <input type="submit" value="slet"> </form> <? } ?> </div> <? } } if(session_is_registered(mitbrugernavn)){ echo "<a href=\"tilfoj-nyheder.php\" title=\"Tilføj nyhed\">Tilføj nyhed</a>"; } ?> </body> </html> Hello! I am trying to make a delete button for my news, but I have no idea how it works. The code for the button starts at line 68. PS. Im new here correct me if posting this wrong! Thanks in advance!
-
MYSQL version --> 5.0.91 ALTER TABLE products ENGINE=INNODB; The error is that it responds that it changed the engine type, but when I view the database in mysqladmin, the tables are still MYISAM. I really wish I saved the CREATE TABLE commands. Basically, there are three tables. The variable types are VARCHAR, INT, TINYINT, DECIMAL, DATETIME, and YEAR. There are no null fields. One of the tables is a JOIN table, and all three of them possess foreign keys. Please let me know if I left out anything, and thank you in advance for your consideration. I threw together a couple of screen shots. Above the red line shows my command and the response showing that I successfully changed the sessions table. Below the red line shows what I see when I view the database in mysqladmin; the sessions table still has a MYISAM engine type.