On 5/17/05, Pete <[EMAIL PROTECTED]> wrote: > ALTER TABLE DROP ... or something similar. > > I have never used it in a script, so I am not sure.
Yep... Ive got this script going :- ============ $query="ALTER TABLE Events DROP EventID"; $result=mysql_query($query) or die( "Unable to view data1\n" . mysql_error()); $num_rows = mysql_num_rows($result); echo "$num_rows Rows - 55556A\n\n\n\n"; $query = "ALTER TABLE Events ADD EventID int(5);"; $result=mysql_query($query) or die( "Unable to view data2\n" . mysql_error()); $num_rows = mysql_num_rows($result); echo "$num_rows Rows - 55556b\n\n\n\n"; =================== that part is going... - However "EventID' is now blank... - with int(5) setting.. How do I add / make EventID - - I HAVE made it 'Unique' - However I cant seem to get the auto_increment setting to be activated on it... (Ive tried various combinations of commands - from 3-4 different sites - So below - may not set the 'Uniqe' ... ) Latest lines :- ========== $query = "ALTER TABLE Events CHANGE COLUMN `EventID` int(5) NOT NULL AUTO_INCREMENT;"; $result=mysql_query($query) or die( "Unable to view data3\n" . mysql_error()); $num_rows = mysql_num_rows($result); echo "$num_rows Rows - 55556c\n\n\n\n"; I'll try more combinations... - But im following examples from tutorial websites.... PS the error im getting is :- ============== check the manual that corresponds to your MySQL server version for the right syntax to use near 'int(5) NOT NULL AUTO_INCREMENT' at line 1 ============== -- G Stewart Gmail : [EMAIL PROTECTED] 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/
