| | How to convert query resutls to XML
You can display SQL query results in XML format when running mysql from command line:
$ c:/mysql/bin/mysql -u [user_name] -p [database_name] -X -e "SELECT * FROM forums_phpbb_config"
Enter password: ******
config_id
... | | More... 10/26/06 | | | | | | | | |
|
| | How to print SQL query results vertically
In MySQL you can display the query results vertically, so that each column will be shown on a new line with \G switch. Fox example:
mysql> select * from nuke_phpbb_config \G
*************************** 1. row ***************************
config_name: config_id
config_value: 1
*************************** 2. row ***************************
config_name: board_disable
config_value: 0
*************************** 3. row ***************************
config_name: sitename
config_value: yourdomain.com
*************************** 4. row ... | | More... 10/26/06 | | | | | | | | |
|
| | mysqldump
Needless to say you have to backup up MySQL database just like any other rdbms. The utility to backup a MySQL database is mysqldump.
mysqldump -u [username] -p [database_name] > /backup/db_name.sql
The above command will dump the contents of database into an ASCII file. To restore the database you can run ... | | More... 10/25/06 | | | | | | | | |
|
| | How to check the version of MySQL server
To find out the version of MySQL server using command line on localhost run the following:
mysql -V
To check the version on host "myhost" run:
mysql -h myhost -V
You can also see the server version in phpMyAdmin, it will be displayed on the front page.
| | More... 10/25/06 | | | | | | | | |
|
| | How to delete a column
To delete a column from a MySQL table run the following command:
mysql> ALTER TABLE 'table_name' DROP 'col_name';
| | More... 10/25/06 | | | | | | | | |
|
| | Javascript bookmark
Add Javascript code to your page that allows the visitors to bookmark it. Just replace example_url with the actual URL of your page and example_title with the page title.
if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
var url="example_url";
var title="example_title";
document.write(' ... | | More... 10/20/06 | | | | | | | | |
|
|