Witam, czy moglby ktos sie przyjrzec temu skryptowi? co z nim jest nie tak?. Wyswietla sie dobrze.. pobiera i wstawia w formularz dane./.. ale po edycji(lub nie) i wyslaniu pokazuje sie błąd:
Cytat
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /public/snoopy/chkim.php on line 19
Oto skrypt:
<html>
<head>
<title>Edycja działu "Kim jesteśmy"</title>
</head>
<body>
<?php
include("config.php");
{
$_GET['id'];
or
die("nieudane polaczenie z bazą danych");
SELECT *
FROM kimjestesmy
where ID = '.$_GET['id'].';');
$kID = $kRow['ID'];
$kTytul = $kRow['tytul'];
?>
<form method="post" action="
<?php print("$PHP_SELF");?>">
Tytuł:
<input type=text name="kTytul" size=20 value="
<?php print($kTytul); ?>"><br>
Zawartość strony:
<textarea name="kTresc" cols=50 rows=15>
<?php print("$kTresc"); ?></textarea><br>
<input type=hidden name="kID" value="
<?php echo $kID; ?>">
<input type=submit>
</form>
<?php
}
else
{
or
die("nieudane polaczenie z bazą danych");$result = mysql_query("UPDATE kimjestesmy SET tytul = $kTytul, tresc = kTresc WHERE ID = $kID"); if($result > 0)
else
}
?>
</body>
</html>