Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Kasowanie rekordu... troche inaczej
michal20
post
Post #1





Grupa: Zarejestrowani
Postów: 23
Pomógł: 0
Dołączył: 3.04.2005

Ostrzeżenie: (10%)
X----


hej

wyświetlam sobie tabelke:

  1. <?php
  2.  
  3. while ($pole = mysql_fetch_row($wykonaj))
  4. {
  5. print(&#092;"<br> id=\".$pole[0].\"  nick=\".$pole[1].\" pass=\".$pole[2]);
  6. print(&#092;"&nbsp;&nbsp;&nbsp;&nbsp;<a href=register?del=true>USUŃ</a>\");
  7. if ($del==&#092;"true\") $wykonaj = mysql_query(\"DELETE FROM users where id='$pole[0]'\");
  8. }
  9.  
  10. ?>


i chcę aby po naciśnięciu w odnośnik (link) USUŃ skasowała się pozycja


wyskakuje mi taki error:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in ...
(IMG:http://forum.php.pl/uwaga.gif) - nospor
Przenoszę: MySQL -> php Początkujący... /crashu
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Levabul
post
Post #2





Grupa: Zarejestrowani
Postów: 197
Pomógł: 0
Dołączył: 11.07.2005

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


  1. <?php
  2.  
  3. if (!empty($_GET['id']) AND $_GET['del'] == true)
  4.  $wykonaj = mysql_query(&#092;"DELETE FROM users where id={$_GET['id']}\");
  5. #w tym miejscu wpisz to o co zapytał nospor
  6.  while ($pole = mysql_fetch_row($wykonaj))
  7. {
  8. print(&#092;"<br> id={$pole['0']} nick={$pole['1']} pass={$pole['2']}\");
  9. print(&#092;"&nbsp;&nbsp;&nbsp;&nbsp;<a href=register?del=true&id={$pole['0']}>USUŃ</a>\");
  10. }
  11.  
  12. ?>


Ten post edytował Levabul 15.07.2005, 16:19:45
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 17.10.2025 - 07:43