What nextRecord() is? If it is the mysql_fetch_array then you're problem
is that you call it in the while loop.. this is why the server crash! (
last line within while() remove it and try then!) If it is the mysql_fetch_row then you need to do this like
while($i < mysql_num_rows(...)) {
$nextRecord = $dbConn->nextRecord();
while ($nextRecord) {
$book = new TBook($dbConn->field('NR_BOOK'));
echo $book->getTitle().'<br>';
}
$i++;
}
or something like this! the "(...)" = the result of the query.. i don't know exactly what functions you'r class have in it!
Hello to everyone,
I'm manipulating objects in some scripts I've developed, and I've come
across a doubt: I perform a query and do some checkings, but to
perform this checkings I need to instantiate an object, and I really
don't know how to do it without crashing theWeb Server. Let me give an
example (I work in a Library and the example is directed to that):
$dbConn->query('select nr_book from book_loan where cd_user = '.$cdUser);
$nextRecord = $dbConn->nextRecord();
while ($nextRecord) {
$book = new TBook($dbConn->field('NR_BOOK'));
echo $book->getTitle().'<br>';
//how do I destroy the object here?
$nextRecord = $dbConn->nextRecord();
}
If I don't destroy the object the Web Server falls into some kind of
deadlock and kills itself. And I didn't find a good explanation about
how to do that in the PHP documentation in www.php.net
I use Apache 2.0.54 as a Web Server and I use PHP 4.4.1 here at work.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php