|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
FetchRow() gives one row too many
Hi,
When I'm filling up a table with the fetchRow() method, I seem to get one row too many (with no data in it) Here's the code: PHP Code:
And the result is: Code:
. .. ... <tr>...</tr> <tr>...</tr> <tr>...</tr> <tr> <td class="leftColumn"><a href="index.php?action=showEnquete&id=23">nu zou't moeten werken!</a></td> <td>10</td> </tr> <tr> <td class="leftColumn"><a href="index.php?action=showEnquete&id=24">Laatste Test normaal gezien</a></td> <td>11</td> </tr> <tr> <td class="leftColumn"><a href=""></a></td> <td></td> </tr> As you can see at the bottom there's an empty row. How can this happen? |
|
#2
|
|||
|
|||
|
Maybe you call parseCurrentBlock() or parse() another time after the loop?
|
|
#3
|
|||
|
|||
|
Quote:
Nope not doing that Here's the full code: PHP Code:
|
|
#4
|
|||
|
|||
|
The code looks okay. Can you show us your template, please?
|
|
#5
|
|||
|
|||
|
Quote:
Code:
<div id="wrapper">
<h1>Enquetes Overzicht</h1>
<div id="content">
<p>
Klik op de naam van de enquete om deze in te vullen
</p>
<table id="enquetesTable" cellspacing="0">
<tr>
<td class="columnTitleLeft">Naam</td>
<td class="columnTitle">Aantal Vragen</td>
</tr>
<!-- BEGIN row -->
<tr>
<td class="leftColumn"><a href="{ID}">{NAAM}</a></td>
<td>{AANTALVRAGEN}</td>
</tr>
<!-- END row -->
</table>
</div>
</div>
|
|
#6
|
|||
|
|||
|
The template also looks right.
Two ideas for debugging: - add error_reporting(E_ALL); at the beginning of your script - add var_dump($row); in your while loop to see if $row really contains something |
|
#7
|
||||
|
||||
|
Because the extra output does not contain the static portion of the string being put into the ID variable - index.php?action=... the extra output is not coming from the code in that loop in that function. Something else in your code is causing a reference to the template with completely empty variables and causing that empty output.
|
![]() |
| Viewing: Codewalkers Forums > PHP Related > PEAR Packages > FetchRow() gives one row too many |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|