PhpMyAdmin Auto Primary Key

By qufighter Last update Jun 9, 2009 — Installed 21 times. Daily Installs: 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0
Script Summary:
This script automatically sets the first row of any new MySQL table you create to be an auto increment Primary Key int id

Script homepage

This script has no discussions.

start the discussion

This script has no reviews.

Thumb

This script automatically sets the first row of any new table you create (That has more than 1 row) to be an auto increment id integer index(11).

To run on your installation you will probably have to add the install path for your installation to script includes yourself.

If you add a new row or edit existing rows it does nothing. Saves a bunch of time if every time you create a new table you set the first field to be the Primary Key. If not then make sure you find all the changes!


$('field_0_1').value='id';
$('field_0_2').value='INT';
$('field_0_3').value='11';
$('field_0_8').value='AUTO_INCREMENT';//pulldown
$n('field_key_0')[0].checked='checked';//radio

To make this script work in chrome do a find and replace $( with $i( or some variant to make it work. You'll probably have to add a new header to the top as well. [[Untested]].

// ==UserScript==
// @name           VidzBigger
// @match       http://youradmininstallationpath/*
// ==/UserScript==  

Then restart chrome.

If using Firefox and Greasemonkey just add your include by right clicking the monkey and choosing manage user scripts, then select this script and press add next to includes. Its not easy getting chrome to use userscripts yet but if you switch to the beta channel and follow the instructions its possible.