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 2182 posted 8 years ago by satie83
Bei Autocomplete aus größeren Datenbanken ist es sinnvoll, die Datenbankabfrage in eine separate php-Datei zu verlegen.
0 748 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 694 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 581 posted 10 years ago by brownrl
Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
0 844 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 763 posted 12 years ago by claudiowebdesign
Esta funcion limpia un array contra inyección SQL.
0 991 posted 12 years ago by n19ht
Just a simple php insert script.
0 573 posted 12 years ago by JonnySnip3r
0 435 posted 13 years ago by Waldio
0 476 posted 13 years ago by kendsnyder
4 817 posted 13 years ago by takel
0 598 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 401 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 605 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 569 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 1146 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 700 posted 13 years ago by pogosheep
5 693 posted 13 years ago by Nettuts
0 545 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 693 posted 14 years ago by dreadwarrior
Function for sanitize input POST, GET, COOKIE arrays.
2 638 posted 14 years ago by kirik
0 538 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 501 posted 14 years ago by bakkelun
0 660 posted 15 years ago by jonniespratley
« Prev 1 2