Since mysql is on localhost, I can just enable named-pipes (which is how you should have mysql setup if you don't need networking) to get around the problem instead of the workaround listed on that page.For details, see: little note if your scripts sleep a lot, you want to run exactly the same SQL statement 2 times and you have the "My SQL has gone away" error a lot.Try setting the 4th parameter to TRUE as it seems sometimes PHP doesn't spot that resource ID x which it used for the last identical lookup is now dud and so tries to use it, thus bypassing tests such as is_resource() and causing a failure.This is for when mysql_ping() doesn't work for your situation of course.If security is a concern, locate the include file outside of your web root folder.fcgid_module modules/mod_Fcgid Max Request Len 209715200Fcgid Connect Timeout 240Fcgid IOTimeout 240Fcgid Busy Scan Interval 240Fcgid Busy Timeout 240# Esta línea instruye al servidor web para que reconozca un tipo nuevo (php)Add Handler fcgid-script .php# Esta línea indica al servidor web donde está instalado PHP.meaning you can use mysql_query in other functions or in no function at all and PHP will use the connection that you opened.This is a handy bit of knowledge that helps if you have a large site with lots of scripts.
This is not efficient but is sufficient for my purposes for now.
I highly suggest against this method of storing My SQL authentication information.
I recommend creating connect and cleanup functions in a separate include file.
I wouldn't say this is a bug per-se, but it's something to look out for. Both are [email protected] in my win2k install, so my advice for windows is:- create a My SQL user named ODBC with no password- add localhost to ODBC user [right-click ODBC]- set schema previleges to [email protected] use mysql_connect() with no parms, or do not use ;)This turns to work also with odbc_connect:odbc_connect("my DSN", "", "") to use load data local infile function from mysql (at mysql 4.0.16, php 4.3.3), set fifth parameter of mysql_connect() to CLIENT_LOCAL_FILES(128), which based on MYSQL C API ( also mysql server support load file, check by "show variables like 'local_infile' ")Thank 'phpweb at eden2 dot com' to point this out The post from 'Graham_Rule at ed dot ac dot uk' should include the following WARNING: WARING: THE VALUES OF THESE DIRECTIVES WILL BE EXPOSED IF ANY OF THE CODE INCLUDES THE phpinfo() FUNCTION.
The phpinfo() function will print these values clear as day.