Welcome To Snipplr


Everyone's Recent Snippets Tagged mysql



1 ... 6 7 8 9 10 ... 19
1 1591 posted 15 years ago by sjacunningham
sometimes we botch an import, and end up with return or newline characters in the field. So fields which should be empty have \r in them, or fields with text data have an invisible trailing newline. This makes it impossible to match the text values....
0 1718 posted 15 years ago by powerthru
When working on client sites, you often need admin access, instead of requiring them to set up an admin user, just make your own. ref: http://www.dnawebagency.com/how-to-add-an-admin-user-to-the-wordpress-database
2 2175 posted 15 years ago by timkinnane
If you\'ve got a Wordpress install that\'s changed domain or you\'re making a local or development copy, you\'ll need to update the Wordpress DB tables with the new URL.\r\nThe first step is the options table, with siteurl and homeurl. The posts als...
1 1733 posted 15 years ago by timkinnane
Group by user defined price bands.
1 3290 posted 15 years ago by daipratt
1 1423 posted 15 years ago by traeregan
for auto increment ids, when you delete records this will reset the number for the next auto id.
0 1645 posted 15 years ago by matula
To use: $update_sql = querys($sql); or $select_sql = getresult($sql); Used simplify selecting rows from a database. You'll need to pass in the SQL statement.
0 1685 posted 15 years ago by shawntysco
Used to delete rows from the database. \r\nTo use:\r\n$del = delete(\"quick_links\", $_GET[\'id\']) ;
0 1509 posted 15 years ago by shawntysco
Makes basic insert statements a breeze to type while doing basic PHP inserts.\r\n*The function for \\\'querys\\\' on line 44 can be found here: http://snipplr.com/view/40911/query-the-database-php/ *
0 1511 posted 15 years ago by shawntysco
3 2195 posted 15 years ago by matula
5 2124 posted 15 years ago by matula
I’ve recently had to quickly parse an Apache log file, to get basic usage statistics for a site over a month and wanted the ability to quickly process any general logs and store them in a MySQL table, so I’ve made a small package class.log. In...
2 2785 posted 15 years ago by dom111
0 1616 posted 15 years ago by paschim
You have two tables galleries and images, and you need to know how many images each gallery has associated with it. This Query returns the sum of distinct record joined to another table by a common field (gallery_id).
0 2196 posted 15 years ago by jbranca
0 1440 posted 15 years ago by kaartz
Script to backup all MySQL databases and delete copies after X days
1 1765 posted 15 years ago by eusonlito
0 1727 posted 15 years ago by bdani
In a Project i had to save serialized arrays in a MYSQL Database, when i used that i got a Error Message for no reason (Error at offset XX of XX bytes in...). I wrote this little functions to fix that issue. (I dont recommend to save serialized Arra...
0 1836 posted 15 years ago by FreaKzero
Dumps the contents of a mysql database to a .sql file named by the current date.
0 1699 posted 15 years ago by gdvickery
0 1508 posted 15 years ago by moonbather
This is the quick method and painless way to Remove duplicate entries from MySQL
2 1803 posted 15 years ago by lixonic
0 1228 posted 15 years ago by barbelith
Here's a little trick I started using when working with XAMPP for localhost and keeping things in tune with the live configuration variables such as username and passwords to mysql (or whatever you're writing for). The example below figures your w...
1 1446 posted 15 years ago by jackkeller
1 1329 posted 15 years ago by kaartz
1 1834 posted 15 years ago by yeremiloli
A simple wrapper class for MySql around PDO. Also an example on how to use this wrapper for SQLite.
1 1412 posted 15 years ago by Knarf
1 ... 6 7 8 9 10 ... 19