8 Feb
Dump single able to file
Just enter the file name and the table name and the table will be backed up to the file.
1 | mysql_query("SELECT * INTO DUMPFILE './file-name.sql' FROM `table-name`"); |
8 Feb
Just enter the file name and the table name and the table will be backed up to the file.
1 | mysql_query("SELECT * INTO DUMPFILE './file-name.sql' FROM `table-name`"); |
17 Feb
Copies destination files to the current location on the server.
Parameters make it recursive and overrides current files.
Trailing dot, specifies the current location, it can be a pass
to a different dir on the server.
cp -Rf /source/containing/all/files/* .
14 Feb
Get the file part of a url.
turns the url into an array and then gets the last element of the array.
1 | $file = end( explode('/', $url) ); |
12 Feb
This SSH command executes a batch file into the specified database.
mysql -p -u username database_name < file.sql
23 Jan
Facebook Debuging tool. Userful for clearing cache.
http://developers.facebook.com/tools/debug
22 Jan
The number you set will be the next value
—————–
ALTER TABLE `node` AUTO_INCREMENT=1
9 Jan
Syncronize local database with remote one:
——————————————
ssh user@www.domain.com “mysqldump -u remoteUsername –password=remotePassword remoteDBName” | mysql -u localUsername –password=localPassword –host=localhost -C localDBname
Syncronize remote database with local one:
——————————————
mysqldump -u localUsername –password=localPassword –host=localhost -C localDBName | ssh user@www.domain.com “mysql -u remoteUsername –password=remotePassword remoteDBName”
9 Jan
Prevent direct access to php file.
This line does a simple check to see if the BASEPATH is defined. It doesn’t check where it was define ( possible security issue, but should be no big deal.)
1 | if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
26 Oct
Install the AMP in LAMP
sudo yum install httpd php mysql-server mysql