Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged mysql



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 1471 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 1321 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 1324 posted 15 years ago by shawntysco
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 2520 posted 15 years ago by dom111
0 1419 posted 15 years ago by paschim
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 1645 posted 15 years ago by FreaKzero
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 1256 posted 15 years ago by jackkeller
1 1122 posted 15 years ago by kaartz
1 1639 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 1217 posted 15 years ago by Knarf
0 1443 posted 15 years ago by DesignByWilliam
Substitute new_ placeholder in the second line with your new prefix. Run it: http://www.yoursite.com/rename.php and wait until it responds with an OK, usually after a couple of seconds. Delete the rename.php script. Edit the configuration.php file...
0 2621 posted 15 years ago by beneberle
The current time, converted from UNIX timestamp to use in MySQL DATETIME
0 1856 posted 15 years ago by koko
Restricts the vote to one vote per ip per day
0 1154 posted 15 years ago by jretamal
0 1580 posted 15 years ago by Myrddin
0 1640 posted 15 years ago by rifat
1 1631 posted 15 years ago by Myrddin
Here is an old Auth class that i made :)
0 1671 posted 15 years ago by cigraphics
A simple PHP object which connects to a mysql database, selects fields, creates users and more..
0 1576 posted 15 years ago by djstaz0ne
0 1272 posted 16 years ago by coevolve
0 1385 posted 16 years ago by jonniespratley
1 1292 posted 16 years ago by atma
Function to fix char set and collation on mysql tables, see [this link](http://www.barattalo.it/2010/02/11/php-function-to-fix-collation-on-database-fields-of-mysql/ "Fix encoding on db") for examples and more infos.
1 2077 posted 16 years ago by ginoplusio
This is useful for escaping multiple values in a POST array.
0 1620 posted 16 years ago by bradless
0 1461 posted 16 years ago by chrismendis