Below are the list of PHP predefined Magic Constants PHP Magic Constants Name Description __LINE__ The current line number of the file. __FILE__ The full path and filename of the file with symlinks resolved. If used inside an include, the name of the included file is returned. __DIR__ The directory of the file. If used […]
You can initilize local settings in a php file.You can set values like max_execution_time, default_socket_timeout, memory_limit, mysql.connect_timeout, user_ini.cache_ttl, display_errors and log_errorsit always nice to check the errors in PHP files with error_reporting. Below is the sample script to set ini_set values. If you dont want to set every time in PHP script simply set the […]
Below simple program will export mysql data values to excel sheet without using any PHP libraries. Export to Excel Using PHP and Mysql <!–?php </p> <p>//write your db connection</p> <p>$xlsFile= ‘file_’.date(‘Y-m-d’).’.xls’; <br ?–>$separator = "t";</pre> $sql = "Select * from emp"; $Connect = @mysql_connect($DB_Server, $DB_Username, $DB_Password) or die("Failed to connect: " . mysql_error() . " […]