Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged sql
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
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
2643
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
965
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
901
posted 10 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
785
posted 11 years ago by brownrl
Function to prevent sql injection in Like queries, where the characters '_' and '%' can be dangerous.
0
1102
posted 12 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
977
posted 13 years ago by claudiowebdesign
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
571
posted 14 years ago by arucordoba
By using this php snippnet we can store different fields (got by array post) into a sql database
1
756
posted 14 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
743
posted 14 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
1336
posted 14 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
905
posted 14 years ago by pogosheep
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
917
posted 15 years ago by dreadwarrior
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
662
posted 15 years ago by bakkelun