Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MYSQL]Przeglądanie i edycja bazy
RifleMan
post 10.05.2009, 09:18:28
Post #1





Grupa: Zarejestrowani
Postów: 31
Pomógł: 0
Dołączył: 14.02.2008

Ostrzeżenie: (0%)
-----


Witam

Mam problem z tym kodem ale nie wiem o co chodzi (Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\WebServ\httpd\system\index.php on line 16)

Kod
<?php

/**
  * @author Mati
  * @copyright 2009
  */

include('config.php');

$cmd = $_POST["cmd"];

if($cmd != "Usuń")
{
$result = mysql_query("select * from drugs ORDER BY name");
$i=1;
while($wynik=mysql_fetch_array($result))
{
$name=$wynik["name"];
$amount=$wynik["amount"];
$content=$wynik["content"];
$price=$wynik["price"];
?>
<form action="<? echo $PHP_SELF ?>" method="post">
<INPUT TYPE="RADIO" NAME="id" VALUE="<?php echo $id; ?>">
<? echo $i++; ?>
<? echo $nazwa; ?>
<? echo '<Br>'; ?>
<? } ?>

<input class=przyciskdel type="submit" name="cmd" value="Usuń">
<? } ?>

<?
if($cmd == "Usuń")
{
$id = $_POST["id"];
$sql = "DELETE FROM drugs WHERE id=$name";

$result = mysql_query($sql);

echo "Dane zostały usuniete<Br>";
echo "<a href=\"index.php\">Powrót do bazy</a>.";
}



?>


Ten post edytował RifleMan 10.05.2009, 09:18:51
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 13:19