List:General Discussion« Previous MessageNext Message »
From:Graeme B. Davis Date:April 24 1999 1:58pm
Subject:Re: one more thing
View as plain text  
Adam Powell said:
> 
> 
> Sorry about this, before I forget I have one more question.  We run an ad
> network that consists of PHP pages linking to a mySQL database.  We have to
> upgrade to Oracle because basically mySQL cannot hack the number of ads that
> we are serving, however this is waay in the future.  Currently something is
> causing a memory leak in the database, our 450 keeps going up to 999 Meg
> used (the mySQLd process that is) and then starts swapping and the techs
> have to restart it.
> 
> We use queries such as
> 
> $res = mysql("dbname", "SELECT * FROM personal WHERE username='$username'");
> $d = mysql_fetch_object($res);
> mysql_free_result($res);
> echo "Welcome $d->first_name $d->second_name";
> 
> Can anybody tell me any possible reasons, or things to watch out for, that
> may be causing any memory leaks?  There are a LOT of pages like the one
> above, and I think that something fundamentally wrong is happening in all of
> them.
> 
> Thanks again,
> Adam

Ugh, PHP syntax is icky :)  <shameless Roxen plug> To do the same thing in Roxen,
you do:

<sqloutput query="SELECT * FROM personal WHERE username='+username+'">
	Welcome, #first_name# #last_name#.
</sqloutput>

contents of sqloutput are repeated for every matched row returned.

</shameless Roxen plug>

Graeme ;)

Thread
one more thingAdam Powell24 Apr
  • Re: [PHP3] one more thingRasmus Lerdorf24 Apr
  • Re: one more thing(Graeme B. Davis)24 Apr
  • Re: one more thingSasha Pachev24 Apr
  • Re: one more thingAdam Powell24 Apr
    • Re: [PHP3] Re: one more thingRasmus Lerdorf24 Apr
    • Re: one more thingMichael Widenius25 Apr