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 489 posted 5 years ago by satie83
Bei Autocomplete aus größeren Datenbanken ist es sinnvoll, die Datenbankabfrage in eine separate php-Datei zu verlegen.
0 247 posted 6 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 211 posted 6 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 195 posted 7 years ago by brownrl
Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
0 257 posted 8 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 237 posted 9 years ago by claudiowebdesign
Esta funcion limpia un array contra inyección SQL.
0 322 posted 9 years ago by n19ht
Just a simple php insert script.
0 163 posted 9 years ago by JonnySnip3r
0 145 posted 9 years ago by Waldio
0 179 posted 9 years ago by kendsnyder
4 252 posted 10 years ago by takel
0 171 posted 10 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 124 posted 10 years ago by arucordoba
By using this php snippnet we can store different fields (got by array post) into a sql database
1 171 posted 10 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 166 posted 10 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 194 posted 10 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 194 posted 10 years ago by pogosheep
5 194 posted 10 years ago by Nettuts
0 188 posted 10 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 186 posted 11 years ago by dreadwarrior
Function for sanitize input POST, GET, COOKIE arrays.
2 221 posted 11 years ago by kirik
0 148 posted 11 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 175 posted 11 years ago by bakkelun
« Prev 1 2