Re: Retrieving records

From: Date: Tue, 25 Sep 2001 14:14:22 +0000
Subject: Re: Retrieving records
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-9514@lists.php.net to get a copy of this message
Hi try it without the first '$resp=mysql_fetch_array($dados);' in the first php-block! there you actually fetch your first info. In the next php-block you simply overwrite it. --> then you only can process 49 records. Give it a try :) -Oliver dmeles@paraisonet.com.br (Danilo Meles) wrote in news:009001c59733$7b2fe5b0$23cecac8@paraisonet: > > ----- 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 (#9514) next »