Re: alter table statement from within php web page

From: Date: Wed, 02 Oct 2002 05:19:32 +0000
Subject: Re: alter table statement from within php web page
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-22147@lists.php.net to get a copy of this message
Forget it, It works, I was entering a field name with a space in it, and that was causing the problem. Duh! -- Chip phpdbOn Tue, 2002-10-01 at 22:01, Chip Wiegand wrote: > I would like to know how to add columns to an existing table. I've tried > this - > > $qry = mysql_query("alter table exercises add column $fieldname > char($length) not null") or die(sql_error()); > > but it doesn't work, I get this error - > > 1064: You have an error in your SQL syntax near 'lifts, char(25), not > null' at line 1 > > I don't see any reference to this in the php manual or in the two > php/mysql books that I have. > > Anybody know how to do this? > > -- > Chip > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

« previous php.db (#22147) next »