Welcome To Snipplr
Everyone's Recent Snippets Tagged database
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
731
posted 15 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
862
posted 15 years ago by rengber
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
666
posted 15 years ago by brownrl
granting DB specific and general access priveleges from the CLI
1
840
posted 15 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
745
posted 15 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
865
posted 15 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
857
posted 15 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
858
posted 15 years ago by jiggyhat
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
861
posted 15 years ago by theonlyalterego
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
856
posted 15 years ago by rengber
Minimal syntax for cursor use. See URL for SQL 2005 options and improvements.
0
930
posted 15 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
639
posted 15 years ago by philiph
how to rollback data on grails' service ....
for myutil --> please look at
0
756
posted 15 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
1155
posted 15 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
1355
posted 15 years ago by pckujawa
PHP
Convert incorrectly-formatted UTF-8 strings of HTML into correctly-formatted UTF-8 strings of plain text.
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
1895
posted 15 years ago by X3Maverick