Welcome To Snipplr


Everyone's Recent Snippets Tagged mysql



1 ... 11 12 13 14 15 ... 19
4 589 posted 13 years ago by pdswan
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 505 posted 13 years ago by brownrl
Need a function to clean your _POST array before inserting into a database? Just pass $_POST to this function.
1 666 posted 13 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 645 posted 13 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 600 posted 13 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 408 posted 13 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 764 posted 13 years ago by sensimevanidus
Will prompt for user password.
0 413 posted 13 years ago by alvarezrilla
granting DB specific and general access priveleges from the CLI
1 498 posted 13 years ago by stiobhart
CLI commands for backing up mySQL database
2 629 posted 13 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 461 posted 13 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 496 posted 13 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 526 posted 14 years ago by jiggyhat
Este codigo inserta un registro en una base de datos mysql utilizando PHP
0 604 posted 14 years ago by denker
Splitting table users in frequently and infrequently accessed attributes
2 805 posted 14 years ago by Eloi
Saving the IP as Int we save a lot of space and permit do beautibul selects
2 480 posted 14 years ago by Eloi
2 530 posted 14 years ago by craig1709
Add an attribute to existing table
1 537 posted 14 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 524 posted 14 years ago by dawjdh
Simple way to escape string for LIKE statements, useful for searches.
3 462 posted 14 years ago by robv
1 471 posted 14 years ago by apro2000
Export entire database schema to local xml file.
1 533 posted 14 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 523 posted 14 years ago by jdbartlett
Show table size, number of rows, and size of indexes in MySQL.
1 747 posted 14 years ago by zingo
1 ... 11 12 13 14 15 ... 19