Welcome To Snipplr


Everyone's Recent Snippets Tagged mysql



1 ... 11 12 13 14 15 ... 19
Need a function to clean your _POST array before inserting into a database? Just pass $_POST to this function.
1 3237 posted 17 years ago by the_dev
Here is the correct way to turn your mysql results into an array. Forget the other nonsense of useless code. Why type out this long code: "for($i = 0; $array[$i] = mysqli_fetch_assoc($result); $i++) ;" when you can accomplish the same thing with m...
1 2106 posted 17 years ago by the_dev
Handy when web hosts limit database upload size. Create folder in home directory call "mysql_dump", upload and extract mysql file into this directory. Ask web host to enable SSH.
0 2255 posted 17 years ago by hotdiggity
This script shows the top 10 worst indexes (in terms of selectivity %) on the whole MySQL server instance. Selectivity is the percentage of distinct values in an indexed field compared to the number of records in the table. Note that this query can...
1 1775 posted 17 years ago by Eloi
This will create and then populate a MySQL table with a list of the names for countries in existence. Country names are in Turkish language.
0 2720 posted 17 years ago by sensimevanidus
Will prompt for user password.
0 1723 posted 17 years ago by alvarezrilla
granting DB specific and general access priveleges from the CLI
1 1916 posted 17 years ago by stiobhart
CLI commands for backing up mySQL database
2 3209 posted 17 years ago by stiobhart
Use this function to print out all the rows in a table. Specify columns to show using the columnstring parameter: tablulardata(tablename, columnstring); ie: tabluardata("users","username=Username|fname=First Name|lname=Last Name");
1 1922 posted 17 years ago by kilrizzy
Use this function to pull all columns from a single database field. getrowdata(tablename,rowid,prefix); You would call this function like: getrowdata("users",$_SESSION['user'],"user_"); The prefix is the prefix you want for the array names,...
1 2143 posted 17 years ago by kilrizzy
This will create a Navigation from a MySQL database table names. It removes the table name "includes" by default so you can see how to remove any certain tables you wish to not use as a site section. Just plug in your MySQL database details and co...
3 2267 posted 17 years ago by jiggyhat
Este codigo inserta un registro en una base de datos mysql utilizando PHP
0 2146 posted 17 years ago by denker
Splitting table users in frequently and infrequently accessed attributes
2 2225 posted 17 years ago by Eloi
Saving the IP as Int we save a lot of space and permit do beautibul selects
2 1881 posted 17 years ago by Eloi
2 2241 posted 17 years ago by craig1709
Add an attribute to existing table
1 1936 posted 17 years ago by marouanomezzine
In phpMyAdmin you can define strftime formats for your dumped database sql files. Here you are with two formats, one for sigle table export, one for multi-table export.
0 1833 posted 17 years ago by dawjdh
Simple way to escape string for LIKE statements, useful for searches.
3 1802 posted 17 years ago by robv
1 1935 posted 17 years ago by apro2000
Export entire database schema to local xml file.
1 1858 posted 17 years ago by jonniespratley
When you forget to "SET NAMES utf8", you'll probably end up with a bunch of latin1 data in your utf8 column. This query fixes that, CONVERTing the existing data to its correct collation.
4 2253 posted 17 years ago by jdbartlett
Show table size, number of rows, and size of indexes in MySQL.
1 2477 posted 17 years ago by zingo
2 2421 posted 17 years ago by iTony
Database backup function that you can call whenever you want — including nightly CRONs.
6 3446 posted 17 years ago by fackz
0 1801 posted 17 years ago by jonniespratley
I am currently still working on this, and will make changes.
1 2039 posted 17 years ago by jonniespratley
1 ... 11 12 13 14 15 ... 19