Hej
Det er sådan at den skal updater djnavn men den komme frem med en fejl hele tiden . kan ikke se hvad der er galt siden den frem viser det ...
- <?php include("include/database/db.php");?>
- <?
- session_start();
-
- if(isset($_SESSION["logged_in"]) && $_SESSION["logged_in"] == 1)
- {
- $userQuery = mysql_query("SELECT * FROM brugere WHERE id='$_SESSION[user_id]'");
- $userArray = mysql_fetch_array($userQuery);
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <?php
- include("include/admin/header.php");
- ?>
- </head>
- <body>
- <?php
- include("include/admin/logo.php");
- ?>
- <?php
- include ("include/admin/menu.php");
- ?>
- <div id="wrapper">
- <div id="contentadmin">
- <h1>Updater DJ Navn</h1>
- <?php
- $id = $_GET['id'];
- $result = mysql_query("SELECT * FROM `brugere` WHERE id = $id");
- $num_rows = mysql_num_rows($result);
- if ($num_rows == 0) {
- echo "admin_index.php";
- }
- while($row = mysql_fetch_array($result))
- {
- ?>
- <form method="post" action="admin_bruger_djnavnupdate.php">
- <input name="id" value="<?php echo $row['id'];?>" type="hidden">
- <input type="text" name="djnavn" placeholder="<?php echo $row['djnavn'];?>" value="<?php echo $row['djnavn'];?>">
- <br>
- <input type="submit" value="Updater email" name="updater">
- </form>
- <?php
- }
- ?>
- </div>
- <?php
- include("include/footer.php");
- ?>
- </div>
- </body>
- </html>
- <?php
- }
- else
- {
- header("Location: index.php");
- exit();
- }
- ?>
Den siger at fejl ligger her ;
- <?php
- include("include/database/db.php");
-
- if (isset($_POST['updater'])) {
- $id = $_POST['id'];
- $email = $_POST['djnavn'];
-
-
- $tabledata = "UPDATE brugere SET djnavn = '$djnavn' WHERE `id` = $id";
- $resultat = mysql_query($tabledata) or die (mysql_error());
-
- if (mysql_affected_rows() > 0) {
- header("Location: admin_index.php");
- }
- else {
- echo "Der ske en fejl";
- }
- }
- else
- echo "Der ske ingen ting";
- ?>
hvad har jeg gøre galt siden det ikke virker..