Ok, then do this

add these line after $result = MYSQL_QUERY($query);

$number = MYSQL_NUMROWS($result);
i = 0;

IF ($number == 0) :
        PRINT "<CENTER><P>No records found!</CENTER>";
ELSEIF ($number > 0) :
        PRINT "<CENTER><P>There are $number records<BR><BR>";
        WHILE ($i < $number):
                $name = mysql_result($result,$i,"field1");
                PRINT "Record $i is $name<BR>";
                PRINT "<BR><BR>";
                $i++;
        ENDWHILE;
                PRINT "</CENTER>";
ENDIF;

NOTE:

1. Be sure that field1 exist as a column. Para huwag kang malito, I changed
variable $field1 into $name

Hope this helps. The code I gave you is working fine with my mysql & php.

> -----Original Message-----
> From: Gene Ordanza II [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 29, 2000 6:17 PM
> To: Ronneil Camara
> Cc: '[EMAIL PROTECTED]'
> Subject: RE: [plug] OT: PHP/MySQL Question ...
> 
> 
> Hi Ronneil,
>       I tried the code but still got the same message. It's probably
> with how I compiled PHP?
> 
> Error Message:
>       Warning: 0 is not MySQL result index in script1 on line 17
> 
> > $field1 = MYSQL_RESULT($result, 0, "field1");
> > print "$field1<BR>";
> 
> 
> --gene
> 
> 
> 
> -
> Philippine Linux Users Group. Web site and archives at 
http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

-
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Reply via email to