Prikazi cijelu temu 24.08.2010 23:26
laponac84 Van mreze
Clan
Registrovan od:20.11.2008
Lokacija:Lapovo, Srbija


Predmet:Warning: mysql_fetch_assoc() expects...
Citat:
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\Program Files\EasyPHP-5.3.3\www\index.php on line 29

29-a linija glasi

Citat:
while ($row = mysql_fetch_assoc($get))

evo i celog koda

PreuzmiIzvorni kôd (PHP):
  1. [quote]<?php
  2. //connection to the database
  3. require 'config.php';
  4.  
  5. //max display per page
  6. $per_page = 5;
  7.  
  8. //get start variable
  9.     if(isset($_GET['start'])){
  10.         $start = $_GET['start'];
  11.     }else{
  12.         $start = 0;
  13.     }
  14.  
  15. //count records
  16. $record_count = mysql_num_rows(mysql_query("SELECT * FROM igraci"));
  17.  
  18. echo "U bazi je $record_count igraca<br />";
  19.  
  20. //count max pages
  21. $max_pages = $record_count / $per_page; //may come out decimal
  22. echo "Bice prikazanu ukupno $max_pages strana u tabeli";
  23.  
  24.     if (!$start)
  25.         $start = 0;
  26.    
  27. //display data
  28. $get = mysql_query("SELECT * FROM igraci, $start, $per_page");
  29.     while ($row = mysql_fetch_assoc($get))
  30.     {
  31.     //get data
  32.     $id = $row['ID'];
  33.     $naziv = $row['Ime'];
  34.     $zemlja = $row['Zemlja'];
  35.     $Pozicija = $row['Pozicija'];
  36.     $Godine = $row['Godine'];
  37.     $Visina = $row['Visina'];
  38.     $Tezina = $row['Tezina'];
  39.    
  40.     echo $id;
  41.     }
  42. ?>[/quote]
Kako da ispravim ovo ?
Ovaj post je ureden 1 puta. Posljednja izmjena 24.08.2010 23:40 od strane zxz.