Re: Alter Table newbie help needed ...

From: Date: Sun, 20 Apr 2008 18:08:11 +0000
Subject: Re: Alter Table newbie help needed ...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-273326@lists.php.net to get a copy of this message
On 4/20/08, revDAVE <Cool@hosting4days.com> wrote: > > On 4/19/2008 2:37 PM, "Jason Norwood-Young" <jason@freespeechpub.co.za> > wrote: > > > Might be obvious but you are doing "mysql_query($sql);", right? > > Hello Jason, > > Thanks - Your idea worked well - for a while - but then I ran into > trouble... > > I added : mysql_error() and it said: > > > Table 'connect2.ztest' doesn't exist > > - so I guess it was not knowing to use the 'try1' connection ( try1.ztest) > - > (connect2 was some other one I set up for something else) > > I'm using Dreamweaver cs3 - maybe it's confused? > > Q: Is there a way to insure that it uses the right connection ( try1 - not > connect2 )? > > > BTW: I tried try1.ztest but it didn't like that: > > $sql = 'ALTER TABLE try1.ztest ADD > myfield2 VARCHAR(10) NOT NULL;'; Is try1 the name of a database? The SQL syntax is databasename.tablename.fieldname. When you issue a query using mysql_query() you can explicitly indicate the connection (returned by mysql_connect()) to use as the second parameter, e.g., mysql_query($sql_Statement, $returnedConnectionObject); HTH, David

« previous php.general (#273326) next »