Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php/mysql] Use of undefined constant
bangoo
post
Post #1





Grupa: Zarejestrowani
Postów: 41
Pomógł: 0
Dołączył: 14.03.2007

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


Niema zabardzo co tu opisywac wiec... ponizej sa bledy ktore mi się wyświetlają po uruchomieniu skryptu
Cytat
Notice: Use of undefined constant id - assumed 'id' in C:\Program Files\xampp\htdocs\CMS\rescouces\articles.php on line 11

Notice: Use of undefined constant title - assumed 'title' in C:\Program Files\xampp\htdocs\CMS\rescouces\articles.php on line 12

[...] (ten sam blad do reszty zmiennych)

Notice: Undefined variable: id in C:\Program Files\xampp\htdocs\CMS\rescouces\artykul.php on line 4


Poniżej jest funkcja wykonująca odbieranie danych z bazy danych
  1. <?php
  2. function ShowArticle($id){ //Funkcja wyświetlająca artykuły
  3. global $title, $authorid, $date, $text, $shorttext, $image;
  4. $Query = "SELECT * FROM ARTICLES WHERE ID = '".$id."'";
  5. $torow = mysql_query($Query) or die(mysql_error());
  6. while($row = mysql_fetch_array($torow))
  7. {
  8.  $id = $row[id];
  9.  $title = $row[title];
  10.  $authorid = $row[authorid];
  11.  $date = $row[date];
  12.  $text = $row[text];
  13.  $shorttext = $row[shorttext];
  14.  $image = $row[image];
  15. }
  16.  
  17. };
  18. ?>


A tutaj jej wykonanie
  1. <?php
  2. include ('articles.php');
  3. ShowArticle("2");
  4. echo $id, $title, $authorid, $date, $text, $shorttext, $image;
  5. ?>
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: 3.10.2025 - 16:44