Welcome To Snipplr


Everyone's Recent PHP Snippets Tagged sql



« Prev 1 2
In SQL I can get this by adding AND to the join LEFT JOIN installations i ON a.id = i.app AND i.page = :page This way I get the installation info for an app that has an installation on the page, but I get null values on the columns for app's that...
0 2256 posted 9 years ago by satie83
Bei Autocomplete aus größeren Datenbanken ist es sinnvoll, die Datenbankabfrage in eine separate php-Datei zu verlegen.
0 778 posted 9 years ago by ulfinger
WE-Objekte ohne Umwege direkt aus php erstellen. Das ist vor allem dann sinnvoll, denn die Eingaben vorher geprüft und verarbeitet werden sollen oder wenn ein Eingabeformular über mehrere Seiten geht.
0 728 posted 9 years ago by ulfinger
When using PDO with sQlite ->rowCount() doesn't work. the recommendation is to do a pre query to get the number. Thus, I created this snippet to help things along.
0 605 posted 10 years ago by brownrl
Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
0 888 posted 11 years ago by TimoZachi
That's something quick. A basic php class to manage properly a database. Thanks to magic methods opening a database is almost automatic.
1 795 posted 12 years ago by claudiowebdesign
Esta funcion limpia un array contra inyección SQL.
0 1041 posted 12 years ago by n19ht
Just a simple php insert script.
0 605 posted 13 years ago by JonnySnip3r
0 451 posted 13 years ago by Waldio
0 505 posted 13 years ago by kendsnyder
4 854 posted 13 years ago by takel
0 623 posted 13 years ago by Waldio
Existen varias formas para hacerlo, pero lo que dejo aquí es a lo que tenemos que acostumbrarnos a hacer cada vez que programemos para prevenir que se pueda inyectar HTML o modificar las consultas SQL.\r\n\r\nThere are several ways to do it, but wha...
0 426 posted 13 years ago by arucordoba
By using this php snippnet we can store different fields (got by array post) into a sql database
1 627 posted 13 years ago by juanchifc
By using this snippnet we can recover and show on a table the items stored into a sql database managed with mysql.
1 596 posted 13 years ago by juanchifc
First you have to add a custom value with a correct date format. The lines: `AND CAST(wpostmeta.meta_value AS DATE) > '".date("Y-m-d H:i:s")."' AND CAST(wpostmeta.meta_value AS DATE) < '".date("Y-m-d H:i:s", $date2)."' ` are only used to select d...
0 1183 posted 13 years ago by Mat_
You can get the last query by using the following code. Insert the first line before the query and TYPO3 will store each query. You can get the last query with the second line.
3 733 posted 13 years ago by pogosheep
5 727 posted 13 years ago by Nettuts
0 563 posted 14 years ago by coevolve
This snippet is usable for telephone number normalization. It supports re-mapping of misused alphabetical characters (e.g. i for 1) and some other clean up stuff... Take a look. Update, 2009-10-02: added function to create a corresponding MySQL RE...
1 736 posted 14 years ago by dreadwarrior
Function for sanitize input POST, GET, COOKIE arrays.
2 665 posted 14 years ago by kirik
0 568 posted 14 years ago by iloveitaly
Pretty straight forward implementation of mysql instantiation using php5 oop. Example usage at the bottom. The database in the example is named 'example_database' and has 1 table, 'newstable'. This table has three columns: 'id,heading,message'. By...
0 527 posted 14 years ago by bakkelun
0 690 posted 15 years ago by jonniespratley
« Prev 1 2