Welcome To Snipplr


Everyone's Recent Snippets Tagged database



A Django model manager capable of using different database connections. Inspired by: * [Eric Florenzano](http://www.eflorenzano.com/blog/post/easy-multi-database-support-django/) * [Kenneth Falck](http://kfalck.net/2009/07/01/multiple-data...
1 1554 posted 16 years ago by rix
From StackOverflow. I'm still not quite happy with my understanding of it, but it looks an order of magnitude more elegant than most I've found.
0 1890 posted 16 years ago by rengber
0 1625 posted 16 years ago by iloveitaly
This is a long over due update to my db insert building function. Please not that the function is the important part the code below is just prove that it works... l:-)
1 1520 posted 17 years ago by brownrl
1 1983 posted 17 years ago by StrawMan
Use to get all database results on a SQL query
0 1588 posted 17 years ago by erichelgesen
granting DB specific and general access priveleges from the CLI
1 1826 posted 17 years ago by stiobhart
CLI commands for backing up mySQL database
2 3098 posted 17 years ago by stiobhart
Use this function to print out all the rows in a table. Specify columns to show using the columnstring parameter: tablulardata(tablename, columnstring); ie: tabluardata("users","username=Username|fname=First Name|lname=Last Name");
1 1815 posted 17 years ago by kilrizzy
Use this function to pull all columns from a single database field. getrowdata(tablename,rowid,prefix); You would call this function like: getrowdata("users",$_SESSION['user'],"user_"); The prefix is the prefix you want for the array names,...
1 2021 posted 17 years ago by kilrizzy
For a client I needed a bit of code that could split one file (html, editable through wysiwyg editor) to multiple files, since all files would by default become very long. This code splits one file by the <h1> tag. Easy for end-users to set. Use CSS...
0 1839 posted 17 years ago by axtg
This will create a Navigation from a MySQL database table names. It removes the table name "includes" by default so you can see how to remove any certain tables you wish to not use as a site section. Just plug in your MySQL database details and co...
3 2156 posted 17 years ago by jiggyhat
Tags: C3P0, datasource, spring, database, java
1 3270 posted 17 years ago by mahome
8 2145 posted 17 years ago by michaelfox
This sql query will select the past version information about a given file from the database. An example would be searching for %ApprovalHistoryVOImpl% would return all past version numbers (in the database) for the ApprovalHistoryVOImpl.class file....
0 1885 posted 17 years ago by theonlyalterego
2 2322 posted 17 years ago by iTony
This as it sits isn't an improvement on what happens by default. It's only useful combined with a compensating transaction or sad path in the catch block, or in allowing a loop to continue.
0 1830 posted 17 years ago by rengber
0 4126 posted 17 years ago by webonomic
Minimal syntax for cursor use. See URL for SQL 2005 options and improvements.
0 1889 posted 17 years ago by rengber
paste it in wp-config.php and make sure the prefixes are right (wp_* is default) also the blogs must be installed on the same database with different prefixes. For example, you might have a primary blog with the table prefix wp_ on the database...
0 1402 posted 17 years ago by philiph
3 1923 posted 17 years ago by oli
how to rollback data on grails' service .... for myutil --> please look at
0 1816 posted 17 years ago by callmeblessed
I need to create all table in InnoDB in my grails application. you can add this / edit the following code on grails-app/conf/Datasource.groovy
1 2688 posted 17 years ago by callmeblessed
This snippet is actually tested for SQL Server Compact Edition (CE) 3.5, but it will probably work for other SQL Server editions. Once you have an SQL CE db up and running, you can set the connection string to point to any directory and database by s...
0 2849 posted 17 years ago by pckujawa
Useful for taking incorrectly-formatted UTF-8 strings containing HTML data, and converting them to correctly-formatted UTF-8 plain text. A handy tool for displaying HTML stored in a database.
4 3257 posted 17 years ago by X3Maverick