Welcome To Snipplr
Everyone's Recent PHP Snippets Tagged mysql
- 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
2646
posted 9 years ago by satie83
This is the basic code that you need to know to connect and list data with PDO.
Don't use de old method (mysql_connect and mysqli_connect) to connect and interact with databases.
0
1111
posted 9 years ago by snstro
The code below can be used to lookup IP address in bulk in return of geolocation information using PHP programming languages and MySQL database. In this tutorial, we use the IP2Location LITE database to lookup country of origin from the visitor's IP...
1
1361
posted 9 years ago by Hexahow
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
903
posted 10 years ago by ulfinger
In this tutorial I will go over implementing Full-Text search in Laravel 4 .
Those who have used Laravel 3 in the past may remember that there used to be support for FULLTEXT indexes. This functionality has been removed in Laravel 4 but can still ea...
0
794
posted 10 years ago by CreativePunch
While the Pinnacle Cart API can handle some of this, I found it easier to query the database directly.
This PCProduct class was developed for integrating Pinnacle Cart with WordPress with the following methods:
- get_product($id)
- get_product_by...
1
1061
posted 10 years ago by crypticsoft
This is a public jsonp api. I use it with jQuery Like This:
$.getJSON("http://yourdomain/yourpath/jsonp_api.php?method=getSchema¶ms=your_db_name&jsoncallback=?",
function(data){
//DO SOMETHING WITH THE DATA HERE
}...
1
1092
posted 12 years ago by halk
Allows you to connect to different datasources. Very common to use something like this for development,staging and production deployments.
0
798
posted 12 years ago by evinweissenberg
Takes your table name and key=>value array of values and returns the text for inserting into a MySQL database. Automatically surrounds strings with single quotes.
1
1088
posted 12 years ago by lemcoe9
Author: J. van Hemert
Fixes encoding when utf-8-encoded data
is stored in tables with other (e.g.
latin_swedish_ci) encoding.
Will convert all columns in all tables
to utf8_general_ci.
0
1010
posted 12 years ago by sjasliek
If the image source is not in the database a default image is displayed.
0
1407
posted 12 years ago by blantonious
Creates table structure for pitchfx data that is provided by mlb.com. Open PHP file and enter username and password for localhost. Feel free to customize to suit your preference.
0
872
posted 12 years ago by wa-rufio
Open PHP file and enter User Credentials for localhost. The default dates are set to negotiate the 2011 season, but change the date variables to match your desired season data. The start date should be the day before opening day, and the end date t...
0
898
posted 12 years ago by wa-rufio
This is a very rudimentary function used to convert a Datetime delivered by the Twitter API to a format you can store in MySQL's datetime field.
0
1489
posted 13 years ago by aristoworks
Sometimes a legacy database will have HTML entities stored in it.
This function converts them. Note that this function assumes you have a database abstraction layer, and may need to be modified to connect to YOUR database.
0
2241
posted 13 years ago by f6design
This is a custom class for caching results through php's session. The class can be used to cache anything, but i use it to cache mysql results so i don't have to get all the time the results by querying MySQL (wich may take a long time, especialy if...
0
1177
posted 13 years ago by TimoZachi
Just a short little script that takes a mysql query and turns it into a csv file that downloads automatically. If your interested in the details you can hit up the link.
0
918
posted 13 years ago by FatFolderDesigner