Gegen Bilderklau - Das Original (https://www.gegen-bilderklau.net/index.php)
- Design, Website, Copyright (https://www.gegen-bilderklau.net/board.php?boardid=80)
--- Homepagehilfe (https://www.gegen-bilderklau.net/board.php?boardid=27)
---- Homepagehilfe - Archiv (https://www.gegen-bilderklau.net/board.php?boardid=139)
----- [PHP & MySQL] [PHP/MySQL] Datensätze werden nicht aktualisiert | gelöst (https://www.gegen-bilderklau.net/thread.php?threadid=149119)


Geschrieben von Startpost-Retter am 23.01.2009 um 22:16:

  [PHP/MySQL] Datensätze werden nicht aktualisiert | gelöst

Hallo GB'ler,

mal wieder habe ich ein Problem: ich möchte das Prpfil des Nutzers aktualisieren. Die Daten werden auch auf der profiledit.php angezeigt, leider werden sie aber nicht in die Datenbank übernommen. Er sagt zwar "Eintrag erfolgreich", aber hinterher sieht's genauso aus wie vorher. Ich kann den Fehler einfach nicht finden.

Wäre um Hilfe sehr dankbar.

action_profiledit.php
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
<?php
   include('db.php');
  $uname = $_POST['uname'];
  $email = $_POST['email'];
  $passwort1 = $_POST['passwort'];
  $website = $_POST['website'];
  $haustiere = $_POST['haustiere'];
  $hobbys = $_POST['hobbys'];
  $selbstbeschreibung = $_POST['selbstbeschreibung'];
  $fuhsetal = $_POST['fuhsetal'];
  
  $passwort = md5($passwort1);
  
  $aendern = "UPDATE mitglieder SET email = '$email', passwort = '$passwort', website = '$website',  Shaustiere = '$haustiere', hobbys = '$hobbys', selbstbeschreibung = '$selbstbeschreibung', fuhsetal = '$fuhsetal' WHERE name = '$uname'";
              $update = mysql_query($aendern);
              
   if($aendern==true) {
         echo "<b>Eintrag erfolgreich</b><br>
         $uname, dein Profil wurde aktualisiert.";
         
         } 
else {
         echo "Fehler!";
      }
      
?>


profiledit.php
php:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
<?php 
@session_start();
$uname = $_SESSION["user_name"];
include "checkuser.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Language" content="de">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>jobs</title>
<link rel="stylesheet" href="style.css"></head>

<body>
<div class="ueber">Profil editieren</div><br>
<br>
<br>
<?php

include("db.php");

$Ergebnis = mysql_query( "SELECT * FROM `mitglieder` where name='$uname'" );
if (mysql_num_rows($Ergebnis) == 0) {
echo "Ein interner Fehler ist aufgetreten!";
}

else {
$Data = mysql_fetch_array( $Ergebnis );

echo "<form name="form1" method="post" action="action_profiledit.php"><table width="75%" border="0">
  <tr>
    <td><strong>Name</strong></td>
    <td>
      
      <input name="uname" type="text" id="textfield" value="$Data[name]"><br> 
        (diesen bitte NICHT &auml;ndern, nur eingeben!)        </td>
  </tr>
  <tr> 
 <tr>
    <td><strong>E-Mail</strong></td>
    <td>

      <input name="email" type="text" id="textfield" value="$Data[email]">
      </td>
  </tr>
  <tr>
    <td><strong>Passwort</strong></td>
    <td><input name="passwort" type="password" id="textfield" value=""></td>
  </tr>
  <tr>
    <td><strong>Website</strong></td>
    <td><input name="website" type="text" id="textfield" value="$Data[website]"></td>
  </tr>
  <tr>
    <td><strong>Eigene Haustiere</strong></td>
    <td><strong>Hobbys</strong></td>
  </tr>
  <tr>
    <td>
      <textarea name="haustiere" id="textarea" cols="45" rows="5">$Data[haustiere]</textarea>
</td>
    <td><textarea name="hobbys" id="textarea" cols="45" rows="5">$Data[hobbys]</textarea></td>
  </tr>
  <tr>
    <td><strong>Selbstbeschreibung</strong></td>
    <td><strong>So finde ich Fuhsetal</strong></td>
  </tr>
  <tr>
    <td><textarea name="selbstbeschreibung" id="textarea" cols="45" rows="5">$Data[selbstbeschreibung]</textarea></td>
    <td><textarea name="fuhsetal" id="textarea" cols="45" rows="5">$Data[fuhsetal]</textarea></td>
  </tr>
  <tr>
    <td colspan="2">
      <input type="submit" name="button" id="button" value="Profil editieren">
    </td>
    </tr>
</table>
</form>";
}
?>
</body>
</html>


Liebe Grüße, Jule


Forensoftware: Burning Board, entwickelt von WoltLab GmbH