Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> pusta tabela, zapytanie zwraca 217 rekordów danych nie widać
mika1
post
Post #1





Grupa: Zarejestrowani
Postów: 10
Pomógł: 0
Dołączył: 15.05.2007

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


Witajcie,

korzystam z gotowca pobranego z http://www.datatables.net/ . W pliku new2.php mam fragment w ktorym wycagam dane z bazy. Zapytanie wykonuje sie, pętla wykonuje się tyle razy ile jest zwróconych rekordów ale danych w tabeli nie widać.

Kod
<?php
include('index.php');
include "databaseconfig15.php";
//$_SESSION["user_level"]!=1;
//$polaczenie=true;
$zapytanie= 'SELECT Numer, Id, Ilosc, Miara FROM Tabela_1 where Numer in (select Numer from Tabela_2 where Kod = "00-210" and Status = "2")';
$wynik = mysql_query($zapytanie) or die(mysql_error());
?>
<p></p>
<div>
<table  id="datatables">
<thead>
<tr>    
    <th>Numer</th>
    <th>Data</th>
    <th>Ilosc</th>
    <th>Miara</th>
</tr>
</thead>

<tbody>
<?php

while ($rekord = mysql_fetch_assoc($wynik)){
    ?>
    <tr>
        <td><?=$rekord['Numer']?></td>
        <td><?=$rekord['Id']?></td>
                <td><a>xy </a></td>
        <td><?=$rekord['Ilosc']?></td>
        <td><?=$rekord['Miara']?></td>
    </tr>
    <?php
    }
?>
</tbody>
</table>
</div>
</body>
</html>


Zero błędów. Wynik ja poniżej. Tabela z pustymi wierszami a pod nią: Showing 1 to 10 of 217 entries.

Co robię źle?

Z góry dzięuje za pomoc, pozdrawiam
B
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
freewalker
post
Post #2





Grupa: Zarejestrowani
Postów: 90
Pomógł: 4
Dołączył: 14.02.2015

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


a nie powinno być:

  1. <tr>
  2. <td><?=$rekord['numer']?></td>
  3. <td><?=$rekord['id']?></td>
  4. <td><a>xy </a></td>
  5. <td><?=$rekord['ilosc']?></td>
  6. <td><?=$rekord['miara']?></td>
  7. </tr>


zamiast:

  1. <tr>
  2. <td><?=$rekord['Numer']?></td>
  3. <td><?=$rekord['Id']?></td>
  4. <td><a>xy </a></td>
  5. <td><?=$rekord['Ilosc']?></td>
  6. <td><?=$rekord['Miara']?></td>
  7. </tr>


Ten post edytował freewalker 18.02.2015, 23:01:44
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: 14.10.2025 - 09:42