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
216
posted 11 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
223
posted 11 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
166
posted 11 years ago by brownrl
granting DB specific and general access priveleges from the CLI
1
177
posted 11 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
191
posted 11 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
193
posted 11 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
205
posted 11 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
197
posted 11 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
180
posted 11 years ago by theonlyalterego
This is a method of my database class which let me sift the unsafe data inputs down.
3
267
posted 11 years ago by lajevardi
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
209
posted 11 years ago by rengber
Minimal syntax for cursor use. See URL for SQL 2005 options and improvements.
0
226
posted 11 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
157
posted 11 years ago by philiph