Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged database



http://twitter.com/jose_506
0 1545 posted 15 years ago by jose_506
0 1652 posted 16 years ago by saturnxxi
Takes a .sql file and runs trough that, each line as an update_sql. Very usefull to track and migrate your blocks/views/cck etc changes.
0 1409 posted 16 years ago by berkes
0 1199 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 1134 posted 16 years ago by brownrl
1 1553 posted 16 years ago by StrawMan
Use to get all database results on a SQL query
0 1214 posted 16 years ago by erichelgesen
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 1442 posted 16 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 1606 posted 16 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 1430 posted 16 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 1702 posted 16 years ago by jiggyhat
8 1676 posted 16 years ago by michaelfox
2 1882 posted 16 years ago by iTony
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 1111 posted 16 years ago by philiph
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 2779 posted 17 years ago by X3Maverick
This is a simple but powerful tweak to the wp-config.php file that will make it easy to run multiple websites using one database and codebase. Simply change "yourdomain.com" with your domain and that's it. Repeat that line for new domains.
2 2263 posted 17 years ago by jonhenshaw
1 2574 posted 17 years ago by ghwilson4456
I always forget how to do this...
2 1527 posted 17 years ago by davidsword
Drupal helper function to debug a table. Returns the contents and some explanation of a database table in a rendered format (HTML table). **NOTE** You REALLY do not want to put this function behind any kind of menu_callback and/or on other pages....
1 2499 posted 17 years ago by berkes
Been wanting to made one of these for a while and finally I got round to it. For some examples please visit the post: http://www.dom111.co.uk/blog/coding/db/8 Any comments suggestions appreciated. CreativeCommons ShareAlike
3 2786 posted 17 years ago by dom111
0 1394 posted 17 years ago by mikegreen
I deleted the old one by accident trying to edit it.
9 3065 posted 17 years ago by mattkenefick
1 1396 posted 17 years ago by mikegreen
Any time I make PHP applications that interact with a database, I use this script. It generates one or more self-populating "View Objects" (a class that represents a single record from a DB). For example, rather than access a MySQL record-set by arra...
1 1627 posted 17 years ago by donkawechico