Retrieving records

From: Date: Tue, 02 Aug 2005 07:26:21 +0000
Subject: Retrieving records
Groups: php.windows 
Request: Send a blank email to php-windows+get-1457@lists.php.net to get a copy of this message
----- Original Message ----- From: "Danilo Meles" <dmeles@paraisonet.com.br> To: <php-windows@list.php.net> Sent: Tuesday, August 02, 2005 4:21 AM Subject: Retrieving records > Hi everyone; > > I'm trying to retrieve data from a table inmy database, I've used the php > code as you can see below. But supose the table has 50 records, the code > above only retrieve 49 records. > > what I'm doing wrong??? Can you help me??? > > Thank's a lot !! > > Danilo Meles > > <? > mysql_pconnect("host","root","password") > or die("Unable to connect to SQL server"); > mysql_select_db("pesquisa") or die("Unable to select database"); > $query="Select * from coleta order by id asc"; > $dados = mysql_query($query) or die("Select Failed!"); > $resp = mysql_fetch_array($dados); > ?> > > <? > while($resp = mysql_fetch_array($dados)){ > ?> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> > > <html> > <head> > <title>Untitled</title> > </head> > > <body bgcolor="White" leftmargin=0 topmargin=0> > <table cellspacing="2" cellpadding="2" border="0"> > <tr> > <td><?echo $resp[pergunta];?></td> > <td><a href="link.php?id=<?echo > $resp[id];?>">Responder?</a></td> > </tr> > <tr> > <td></td> > <td></td> > </tr> > <tr> > <td></td> > <td></td> > </tr> > </table> > > > > > </body> > </html> > <?}?> >

« previous php.windows (#1457) next »