RE: [PHP-WINDOWS] ODBC_PHP4
| From: | Darvin Andrioli | Date: | Wed, 21 Jun 2000 17:13:32 +0000 |
| Subject: | RE: [PHP-WINDOWS] ODBC_PHP4 | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-566@lists.php.net to get a copy of this message | ||
Ciao Maurizio
you made two mistake.
1) the equal operator is ==, not =, so $p=0 should be $p==10. In your code you assign 10 to $p, and
this operation is always true, and then you get an never end loop
2) the statement for ( $p=1;$p==10;$p++), should be for($p=1;$p<10;$p++)
Bye
Darvin Andrioli
-----Original Message-----
From: Maurizio Piccolo [SMTP:mpiccolo@bci.it]
Sent: Wednesday, June 21, 2000 6:33 PM
To: php-windows@lists.php.net
Subject: [PHP-WINDOWS] ODBC_PHP4
Evrything is working with my connection to odbc database
But in the cicle for something in php4 is wrong
.
.
.
$res=odbc_exec($conn, $squery);
while ($myrow = odbc_fetch_row($res)) {
for ($p=1; $p=10; $p++){
$value=odbc_result($res,$p);
$strcsv=$strcsv.",".$value.",";
}
}
i this case i obtain a cicle that never end with a value(still the same)
of a filed
insted if i use 1,2..
$valuea=odbc_result($res,1);
$valueb=odbc_result($res,2);
.
.
.
.
it works, it seem to be that i can't use odbc_result($res,$p) in a for
cicle.
Since i have a database with 60 filed i would like use a cicle
Any suggest?
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net