Welcome To Snipplr


Everyone's Recent Snippets Tagged mysql



1 ... 11 12 13 14 15 ... 19
Here is a small function that I use to update records in a database. It coincides with the insertFromPost function that I have posted earlier. The element names in the form need to have the same name as in the DB and the field names should all...
1 1511 posted 16 years ago by brownrl
Need a function to clean your _POST array before inserting into a database? Just pass $_POST to this function.
1 2578 posted 16 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 1505 posted 16 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 1522 posted 16 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 1179 posted 16 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 1940 posted 16 years ago by sensimevanidus
Will prompt for user password.
0 1159 posted 16 years ago by alvarezrilla
granting DB specific and general access priveleges from the CLI
1 1290 posted 16 years ago by stiobhart
CLI commands for backing up mySQL database
2 2506 posted 16 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 1372 posted 16 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 1538 posted 16 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 1604 posted 16 years ago by jiggyhat
Este codigo inserta un registro en una base de datos mysql utilizando PHP
0 1503 posted 16 years ago by denker
Splitting table users in frequently and infrequently accessed attributes
2 1609 posted 16 years ago by Eloi
Saving the IP as Int we save a lot of space and permit do beautibul selects
2 1297 posted 16 years ago by Eloi
2 1626 posted 16 years ago by craig1709
Add an attribute to existing table
1 1359 posted 16 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 1256 posted 16 years ago by dawjdh
Simple way to escape string for LIKE statements, useful for searches.
3 1186 posted 16 years ago by robv
1 1290 posted 16 years ago by apro2000
Export entire database schema to local xml file.
1 1334 posted 16 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 1617 posted 16 years ago by jdbartlett
Show table size, number of rows, and size of indexes in MySQL.
1 1742 posted 16 years ago by zingo
2 1778 posted 16 years ago by iTony
Database backup function that you can call whenever you want — including nightly CRONs.
6 2655 posted 16 years ago by fackz
1 ... 11 12 13 14 15 ... 19