Therefor, add a mysql_data_seek($this->result,0) to reset the pointer.

Furthermore, instead of the for-next loop, I would use while ($row = mysql_fetch_row($this->result).


Foong wrote:
i guess the problem is the last line of your Query function:
$this->ligne = @mysql_fetch_row($this->result);

this line fetch the first row of the result.

therefore, when you call afficheResultatRequete(...)
you start from the second row of the result.


"F.Collineau" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Hi,

I try to display the result of a mysql request but first element misses !
here is my code:

$sql->Query("select marque, reference from base );

 function Query ($query) {
        $this->result = @mysql_query($query, $this->id) or MySQL_ErrorMsg
de lancer la requete: $query");
        $this->rows = @mysql_num_rows($this->result);
$this->nbreChamps = @mysql_num_fields($this->result);
$this->ligne = @mysql_fetch_row($this->result);

function afficheResultatRequete($result,$nbChamps) { for($i=0 ; $row=mysql_fetch_row($result);++$i) { print("<tr>"); $this->color_tab($i); for($j=0;$j<$nbChamps;$j++) { print "<td>"; print((string)$row[$j]); "</td>\n"; } print "</tr>"; }


Whet is the problem ?



Faites un voeu et puis Voila !

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to