PHP variable naming sucks

PHP is a language that deserves curse. For variable names, we always have to use the $ sign. The purpose is of course to add one more thing a programmer can forget. And when you do forget, PHP treats the misnamed variable as a string which in my case causes the script to run but wrongly.

Here’s the golden bug on my script:

$mysql_db = "some_db_name";
mysql_select_db(mysql_db);

No wonder my carefully crafted INSERT query didn’t have any effect…

Share and Enjoy:
  • Digg
  • del.icio.us
  • Technorati
  • Slashdot
  • StumbleUpon
  • Sphinn
  • Facebook
  • Mixx
  • Google
  • TwitThis
  • Live

Tags: , ,

Leave a Reply