Re: [PHP-DB]how to handle exception in php
[email protected] (Luiz Alberto)
| Newsgroups | php.db |
|---|---|
| Message-ID | <1272807151.2002.7.camel@ubuntu-laptop> |
Dear Bavithra,
I would suggest you the following solution
$sql = "SELECT x FROM y";
$rs = mysql_query ($sql)
$num = mysql_numrows($rs);
while ($i < $num){
z = mysql_result($rs, $i, 'x');
$i++;
}
I hope that above solution help you.
Luiz Alberto
On Sun, 2010-05-02 at 10:56 +0530, Bavithra R wrote:
> hi friends
>
> I am doing a simple student mark details project.
> for calculating rank I need to compare the total marks one by one.
> To do so i use *for loop.* so atlast while reaching the end of the table it
> shows the following warning.
> *
> Warning*: mysql_result()
> [function.mysql-result<http://127.0.0.1/pro/function.mysql-result>]:
> Unable to jump to row 18 on MySQL result index on line *50*
>
> It is because it has no next value to compare.How to use try..catch
> exception handling in this.?Or any other suggestion.
> Can anybody help me
>
> --Bavithra