php4-beta | 200004
Date: 04/19/00
- Next message: Mario Flores Rdz: "[PHP4BETA] [PHP4RC1] compile problems under Solaris 7"
- Previous message: Flemming Funch: "Re: [PHP4BETA] Problems with WHILE"
- Next in thread: Frank M. Kromann: "Re: [PHP4BETA] Problems with WHILE"
- Maybe reply: Frank M. Kromann: "Re: [PHP4BETA] Problems with WHILE"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I have been looking for an error in the MS SQL Module for some time now and it now seams like the error is not in this module but in the while loop !
I use the folowing script :
dl("php_mssql70.dll");
print("Before<br>");
$conn = mssql_connect("Online20", "web", "webuser");
if ($conn) {
print("$conn<br>\n");
mssql_select_db("Online20", $conn);
for ($i=0; $i<3; $i++) {
$RS = mssql_query("select * from cNodeType", $conn);
if ($RS) {
print("$RS\n");
$data = array();
do {
if ($tempdata = mssql_fetch_row($RS))
$data[] = $tempdata;
} while (is_array($tempdata));
/*
while (($tempdata = mssql_fetch_row($RS)))
$data[] = $tempdata;
*/
mssql_free_result($RS);
print("<table border=0>\n");
while (list($iRow, $arrRowData) = each($data)) {
print("<tr>\n");
while (list($iCol, $strCol) = each($arrRowData))
print("<td>$strCol</td>");
print("</tr>\n");
}
print("</table>\n");
}
}
mssql_close($conn);
}
print("After<br>");
If I use the do {} while() loop everything works fine but if I use the other loop the script will work fine for the first two runs but it crashes the $RS variable after two calls to mssql_fetch_row. I have testet the variable just before exiting the function and it is not the function that causes the error.
Am i doing anything wrong ?
- Frank
Swwwing A/S
Frank M. Kromann
VP Development
Phone: +45 70 20 77 20
Fax: +45 70 20 77 21
http://www.swwwing.com
-- PHP 4.0 Beta Mailing List <http://www.php.net/version4/> To unsubscribe, e-mail: php4beta-unsubscribe <email protected> For additional commands, e-mail: php4beta-help <email protected> To contact the list administrators, e-mail: php4beta-admin <email protected>
- Next message: Mario Flores Rdz: "[PHP4BETA] [PHP4RC1] compile problems under Solaris 7"
- Previous message: Flemming Funch: "Re: [PHP4BETA] Problems with WHILE"
- Next in thread: Frank M. Kromann: "Re: [PHP4BETA] Problems with WHILE"
- Maybe reply: Frank M. Kromann: "Re: [PHP4BETA] Problems with WHILE"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

