[PHP/MySQL] query geeft eerste record niet terug

Pagina: 1
Acties:
  • 20 views sinds 30-01-2008

  • TheGhost
  • Registratie: December 2001
  • Laatst online: 02-07 10:04
Ik zit met een probleempje:

Ik heb nu de volgende code:
<?php
mysql_select_db($database_VCA, $VCA);
$query_functies = "SELECT * FROM list_functies";
$functies = mysql_query($query_functies, $VCA) or die(mysql_error());
$row_functies = mysql_fetch_assoc($functies);
$totalRows_functies = mysql_num_rows($functies);
?>

en:

<table>
<?php
while($row_functies = mysql_fetch_assoc($functies))
{
echo "<tr>";
echo "<td class=\"veld\" style=\"border-left-width:0px; border-right-width:1px;\">";
echo $row_functies['functie_omschrijving'];
echo "</td>";
echo "</tr>";
}
?>
</table>

In de database staan 5 records, probleem is dat er maar 4 worden weergegeven op de pagina.

Ik heb vanalles opgezocht op 't net maar krijg 't niet goed...
Is er iemand die een oplossing weet?

I'm not weird, I'm a limited edition


  • CodeCaster
  • Registratie: Juni 2003
  • Niet online

CodeCaster

Can I get uhm...

Simpel.
PHP:
1
2
$row_functies = mysql_fetch_assoc($functies);
$totalRows_functies = mysql_num_rows($functies);

en later doe je:
PHP:
1
2
while($row_functies = mysql_fetch_assoc($functies))
{

Je gooit je eerste resultaat weg.

https://oneerlijkewoz.nl
Op papier is hij aan het tekenen, maar in de praktijk...


  • TheGhost
  • Registratie: December 2001
  • Laatst online: 02-07 10:04
Ah, dus dat gaat er fout, maar hoe los ik dat op?
met andere woorden: hoe voorkom ik dat het eerste resultaat weggegooid word?

I'm not weird, I'm a limited edition


  • CodeCaster
  • Registratie: Juni 2003
  • Niet online

CodeCaster

Can I get uhm...

Gewoon die eerste
PHP:
1
$row_functies = mysql_fetch_assoc($functies);

weglaten, want je doet er vervolgens niets mee?

https://oneerlijkewoz.nl
Op papier is hij aan het tekenen, maar in de praktijk...


  • TheGhost
  • Registratie: December 2001
  • Laatst online: 02-07 10:04
_O_ thnx! stom dat ik dat zelf niet in de gaten had!!

I'm not weird, I'm a limited edition


Verwijderd

Gewoon die 1e regel met "$row_functies = ..." weglaten. Waar is die regel voor anyway?

/laat

[ Voor 4% gewijzigd door Verwijderd op 01-04-2007 19:45 ]


  • NMe
  • Registratie: Februari 2004
  • Laatst online: 20-11 11:59

NMe

Quia Ego Sic Dico.

Gewoon even zelf debuggen dus. :) Voorbeelden hiervoor/hierover zijn er genoeg te vinden, overal op het web, daar heb je ons niet voor nodig. :)

'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.

Pagina: 1

Dit topic is gesloten.