Autor Zpráva
Fergi
Profil
Zdravim
mam tu mensi problem s prikazem update.... nevim proc ale stale mi to pise treba Unknown column 'mail' in 'field list' a nemuzu se hnout z mista
je to trosku delsi ale v podstate je to to same....
<?
session_start();
if(!isset($_SESSION['prihlasen']) and @$_SESSION['prihlasen']!=1){
	header("HTTP/1.1 301 Moved Permanently");
        header("Location: /");
        header("Connection: close");
	exit;
}

$nacti=mysql_query("SELECT * FROM uzivatele WHERE id='".$_SESSION['UserId']."'");
if(!$nacti):
  echo "došlo k poruše v komunikaci s databází<br>";
  echo mysql_errno() . ": " . mysql_error() .
  MySQL_Close($spojeni);
  die();
endif;
$zaznam=mysql_fetch_array($nacti);
$jmeno=$zaznam["jmeno"];
$mail=$zaznam["mail"];
$bydliste=$zaznam["bydliste"];
$povolani=$zaznam["povolani"];
$web=$zaznam["web"];
$icq=$zaznam["icq"];
$skype=$zaznam["skype"];
$jabber=$zaznam["jabber"];
$img=$zaznam["img"];
?>
<form action="profil_update.php" method="post">
  <input type="hidden" name="sent" value=""/>
    <strong>Uživatelské jméno</strong><br/>
    <? echo " $jmeno " ?><br/>
    <strong>Heslo</strong><br/>
    <input type="password" name="heslo1" maxlength="32" size="30"/><br/>
    <strong>Heslo znovu </strong><br/>
    <input type="password" name="heslo2" maxlength="32" size="30"/><br/>
    <strong>Email</strong><br/>
    <input type="text" name="mail" value="<? echo "$mail" ?>" maxlength="128" size="30"/><br/>
    <strong>Web</strong><br/>
    <input type="text" name="web" value="<? echo "$web" ?>" maxlength="128" size="30"/><br/>
    <strong>Povolání</strong><br/>
    <input type="text" name="povolani" value="<? echo "$povolani" ?>" maxlength="128" size="30"/><br/>
    <strong>Bydliště</strong><br/>
    <input type="text" name="bydliste" value="<? echo "$bydliste" ?>" maxlength="128" size="30"/><br/>
    <strong>ICQ číslo</strong><br/>
    <input type="text" name="icq" value="<? echo "$icq" ?>" maxlength="10" size="30"/><br/>
    <strong>Skype</strong><br/>
    <input type="text" name="skype" value="<? echo "$skype" ?>" maxlength="280" size="30"/><br/>
    <strong>Jabber</strong><br/>
    <input type="text" name="jabber" value="<? echo "$jabber" ?>" maxlength="280" size="30"/><br/>
<br/>
  <input type="submit" name="send" value="  Uložit  "/><br />
</form>

a v profil_update.php je
(nedivte se jaktoze tam nemam pripojeni do databaze,ale otvira se to pomoci indexu ve kterem pripojeni je... chyba je urcite tady...)
<?
session_start();
if(!isset($_SESSION['prihlasen']) and @$_SESSION['prihlasen']!=1){
	header("HTTP/1.1 301 Moved Permanently");
        header("Location: /");
        header("Connection: close");
	exit;
}

$back=$_SERVER['HTTP_REFERER'];
ob_start(); 
if(isset($_POST['sent'])){ 
 $mail=($_POST["mail"]);   
 $web=($_POST["web"]); 
 $povolani=($_POST["povolani"]); 
 $bydliste=($_POST["bydliste"]); 
 $icq=($_POST["icq"]); 
 $skype=($_POST["skype"]); 
 $jabber=($_POST["jabber"]); 
 $img=($_POST["img"]);    
 if($mail==""){ 
  $backlink="$back?page=registrace&Alert=1";
  }else{ 
  require "db.php"; 
     $zapis = MySQL_Query("UPDATE clanky SET mail='$mail', web='$web', povolani='$povolani', bydliste='$bydliste', icq='$icq', skype='$skype', jabber='$jabber', img='$img' WHERE id='".$_SESSION['UserId']."' ") or Die("Nastala chyba: ".MySQL_Error());            
$backlink="$back?registrace&Alert=8";
}
}else{
$backlink="$back?page=registrace&Alert=5";
}
 header ("Location: $backlink");
ob_end_flush();

?>

za pripadne odpovedi dekuji :)
orava
Profil
asi nemas stlpec
mail
v tabulke
fergi
Profil *
uz vidim chybu :-)
fergi
Profil *
diky :)

Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm: