Welcome To Snipplr
Everyone's Recent Snippets Tagged mysql
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
This could be further abstracted to work with other db's. Also, it really should be using Ruby's Tempfile class instead of assuming the local machine is *NIX based, but it works :)
0
819
posted 15 years ago by nate63179
If you need to list all of the MySQL databases managed by Plesk along with their corresponding domains and login credentials, you can use this query:
1
867
posted 15 years ago by tobewan
Where:
* 3307 is the local port used to connect to the remote database. You can use 3306, however, this could conflict with your PC’s MySQL installation.
* localhost and 3306 is the MySQL address from the remote server (most people will...
0
759
posted 15 years ago by danshields
Must have a field named Weight. The more Weight the more often the record is selected. Weight should be an integer between 1 and 10.
1
884
posted 15 years ago by BFTrick
MySQL Insert Unique Reference using MAX() to obtain latest value
Alternate solution to using Composite Primary Keys which INNODB engine does not support.
0
781
posted 15 years ago by cherbert
This snippet collects a date from a var and formats it into the correct format for database date entry
0
853
posted 15 years ago by daveismyname
Dumps whole query so developer can see where is error. However it's potential security issue, exposing SQL commands to attacker. (Recommended to use only during development, replace message code with some custom error text)
0
1011
posted 15 years ago by acosonic
This piece of code will store each line of a txt file into a mysql database
2
1169
posted 15 years ago by fackz
Outputs MySQL server stats : uptime, threads, questions, slow queries, opens, flush tables, open tables, queries per sec (avg).
2
644
posted 15 years ago by NyX