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
2651
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
1115
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
906
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
796
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
1062
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
1094
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
800
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
1089
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
1012
posted 12 years ago by sjasliek
If the image source is not in the database a default image is displayed.
0
1408
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
875
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
899
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
1491
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
2243
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
1179
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
922
posted 13 years ago by FatFolderDesigner