Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php+mysq] blad w skrypcie
touse
post 12.01.2007, 11:34:51
Post #1





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 12.01.2007

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


Witam po wykonaniu skryptu perser zwraca mi nastepujacy komunikat bledu

Cytat
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\webserv\www\public_html\helpdesk\index.php on line 120


a linia tego kodu to:

  1. <table width="400" border="0" cellpadding="5" align="center">
  2. <tr><td>
  3. <hr align="right" size="1" width="400" noshade>
  4. </td></tr>
  5. <?
  6. while($row = mysql_fetch_array($result)) {
  7.  ?> <tr><td> <?
  8.  if($last_date == $row["date"]): ?>
  9.  <p><b><? echo $row["time"] ?></b>
  10.  <?else:?>
  11.  <p><? echo $row["time"]?> - <b><? echo $row["date"]?></b>
  12.  <?endif;
  13.  $cat_num = $row["category_id"];
  14.  $cat_result = mysql_query("select categories.category from helpdesk, categories where helpdesk.categor
    y_id = categories.category_id and helpdesk.category_id = '$cat_num'"
    );
  15.  $cat = mysql_fetch_array($cat_result);
  16.  ?>
  17.  <br>Kategoria: <i><? echo $cat["category"] ?></i>
  18.  <p><? echo "<b>".$row["title"]."</b>n" ?>
  19.  <p><? echo $row["intro"] ?><br>
  20.  <?
  21.  printf("n<p><a href="index.php?more=%s">[<i>Rozwiązanie Problemu</i>]</a>n", $row["news_id"]);
  22.  printf("n <a href="index.php?add_comment=%s"><i>Dodaj komentarz</i></a>n", $row["news_id"]);
  23.  $last_date = $row["date"];
  24.  ?>
  25.  <hr align="right" size="1" width="400" noshade>
  26.  </td></tr>
  27.  <?
  28. }
  29. ?> </table> <?


Nie wiem co jest nie tak wczesniej stosowany mysql_fetch_array() np:

  1. <?php
  2. }
  3.  function enter_post($author, $password, $title, $intro, $more, $category) {
  4. connect();
  5. $sql = "select * from authors where author_name = '$author'";
  6. $result = mysql_fetch_array($sql);
  7. $row = mysql_fetch_array($result);
  8. if($row["author_password"] !=$password):
  9.  print("<h1>Podane hasło jest nieprawidłowe</h1>");
  10. else:
  11.  $author = $row["author_id"];
  12.  $time = date("H:i:s");
  13.  $date = date("y-m-d");
  14.  $sql = "insert into helpdesk VALUES(NULL,'$title','$intro','$more','$author','$category','$date','$time')";
  15.  mysql_query($sql);
  16. endif;
  17. }
  18. ?>


i kod wykonywany jest pomyslnie Moglbym prosic o pomoc w miare mozliwosci questionmark.gif
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 - 07:15