Archive for May, 2009
kill all for windows
by admin on May.29, 2009, under Windows

Linux has a good command for killing a proccess (or multiple proccesses) from the command line. Well what about windows? It has taskkill:
Taskkill /F /IM process
Mysql_real_escape_string
by admin on May.21, 2009, under Linux

Today I was moving some stuff to a live server and Whaamm my code was giving me the following error:
Access denied for user: 'apache@localhost' (Using password: NO)
I debugged it to be the line containing mysql_real_escape_string. But why did it work on the dev server and not the live? My memory immediately kicked in and remembered having similar problems. The code on live was not using persistent connections (not an issue) and the call to mysql_real_escape_string requires a connection to mysql to be open at the time of call. Since the line of code came before any connection to the database was being made, it caused this error.
Make sure you have a connection to mysql open before calling this method!