Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Small White Dragon
Nov 23, 2007

No relation.

fletcher posted:

All my classes refer to $this->database to interact with the database. Is there any way to avoid having to pass it in as a parameter to a static function of a different class that needs the db?

You could use the singleton design pattern.

Adbot
ADBOT LOVES YOU

Small White Dragon
Nov 23, 2007

No relation.
What's the difference between MYSQLI_USE_RESULT and MYSQLI_STORE_RESULT?

The documentation for mysqli_query doesn't explain the difference between them (and when/why one should be used over another), and most places seem to just copy from there.

Small White Dragon
Nov 23, 2007

No relation.
edit: repeatedly beaten with my slow connection

Small White Dragon fucked around with this message at 23:34 on Mar 14, 2010

Small White Dragon
Nov 23, 2007

No relation.

FeloniousDrunk posted:

php:
<?
$foo();
?>
This is a time-honored tradition. It means "call the function whose name is in foo." It actually comes in really handy in complicated code, and its use is condoned by many experienced programmers -- well, provided you handle the security correctly, anyway.

FeloniousDrunk posted:

php:
<?
${"bar"}();
?>
This works for me in PHP 5.3.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply