Date: 10/27/99
- Next message: Teodor Cimpoesu: "[PHPLIB-DEV] changes to session.inc - coming back"
- Previous message: ak <email protected>: "Re: [PHPLIB-DEV] error in ct_sql.inc"
- In reply to: Teodor Cimpoesu: "[PHPLIB-DEV] Re: [PHPLIB] phplib - changes proposal"
- Next in thread: Kristian Koehntopp: "[PHPLIB-DEV] Re: [PHPLIB] Memory or code/seesion problem?"
- Reply: Kristian Koehntopp: "[PHPLIB-DEV] Re: [PHPLIB] Memory or code/seesion problem?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi
Using functions (odbc_*, and mysql_*) following cod is executed immediatly:
//*******orig code**********//
$mydb=odbc_connect("mydb","user","pass");
$query_select="SELECT id from libri WHERE data=Getdate()";
$result=odbc_exec($mydb,$query_select);
$tot=0;
while (odbc_fetch_row($result)) {
print $i . " - " . odbc_result($result,"id") . "<br>";
$ar[]=odbc_result($result,"id");
$tot++;
}
$i=rand()%$tot+1;
print $ar[$i] . " $i <br>";
?>
//*********end orig cod*********//
BUT this same code with phplib 7.2 with about 30 articles work very slow and
with more 50 articles don't work at all:
//*********phplib cod**************//
if (!$sess->is_registered("id_art") ) {
$query = "select id from articles where data=Getdate()";
$db->query($query);
$tot=$db->num_rows();
while($db->next_record()) {
$id_art[] = $db->f("id"); //all id put into array about 200
}
$sess->register("id_art"); // register array $id_art in session
$sess->register("tot"); // and how many new articles i have
} //end if
$i=rand()%$tot+1; //Extract random number from number of new articles
print $id_art[$i] ; // print random id from array
//**************end******//
Whats wrong?
Can anybody help me?
Thanks all
Serghej Petrov
-
PHPLIB Developers Mailing List. Send messages to <phplib-dev <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-dev-request <email protected>> in
the body, not the subject, of your message.
- Next message: Teodor Cimpoesu: "[PHPLIB-DEV] changes to session.inc - coming back"
- Previous message: ak <email protected>: "Re: [PHPLIB-DEV] error in ct_sql.inc"
- In reply to: Teodor Cimpoesu: "[PHPLIB-DEV] Re: [PHPLIB] phplib - changes proposal"
- Next in thread: Kristian Koehntopp: "[PHPLIB-DEV] Re: [PHPLIB] Memory or code/seesion problem?"
- Reply: Kristian Koehntopp: "[PHPLIB-DEV] Re: [PHPLIB] Memory or code/seesion problem?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

