This removes  a firld / column from a table - re-inserts it, with  the
auto-increment field re-numbered :)


## DROPS THE FIELD

$query="ALTER TABLE Events DROP EventID";
$result=mysql_query($query) or die( "Unable to view data1\n" . mysql_error());
echo "Do 1<br>\n";

### ADDS IT BACK IN - AUTO_NUMBERED

$query = "ALTER TABLE Events ADD EventID INT UNSIGNED NOT NULL
AUTO_INCREMENT, ADD PRIMARY KEY (EventID);";
$result=mysql_query($query) or die( "Unable to view data2\n" . mysql_error());
echo "Do 2<br>\n";



-- 

G Stewart
NZ: [EMAIL PROTECTED]
NZ Bus Website 
http://busnz.kwister.com/ - Updated


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to