Darn forgot to hit "reply to all"

-------- Forwarded Message --------
From: Jason Norwood-Young <[EMAIL PROTECTED]>
To: revDAVE <[EMAIL PROTECTED]>
Subject: Re: [PHP] Alter Table newbie help needed ...
Date: Mon, 21 Apr 2008 23:52:30 +0200

On Mon, 2008-04-21 at 14:04 -0700, revDAVE wrote:
> Jason & David,
> 
> Thanks so much for your help....
> 
> BTW: to reiterate the problem: I guess it was not knowing to use the 'try1'
> connection ( try1.ztest) - and used 'connect2' connection instead...
> 
> Error said : Table 'connect2.ztest' doesn't exist
> (connect2 was some other one I set up for something else)
> 
> Q: Is there a way to insure that it uses the right connection ( try1 - not
> connect2 )?

Hi revDAVE

You'll simplify your life dramatically by using one database and one
connection per application. If you're not going to do that, you can make
sure the table is there in PHP with something like:

function check_table_exists($tablename) {
        $sqlresult=mysql_query("SHOW TABLES LIKE $tablename");
        if (mysql_num_rows($sqlresult)==1) {
                return true;
        }
        return false;
}

J


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to