Re: How to create a table from PHP?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: How to create a table from PHP?

From: mh <marchenri1@gmail.com>
Date: Sun Jul 17 2005 - 23:29:23 CEST

Hello,

Andy Hassall a écrit :
> On 17 Jul 2005 09:42:34 -0700, "mh" <marchenri1@gmail.com> wrote:
>
> >$sql_query="CREATE TABLE '$num' (
>
> Don't put quotes around identifier names. If you must, then in MySQL use
> either ` or ", but not '. ' is for strings, not identifiers.
Ok, but I did that I think. I said in my message that I also tried like
that:
$sql_query = 'CREATE TABLE $num ('
        . ' `variable1` DATE NOT NULL'
        . ' )';
In this case I don't use the quotes around the name of the table but
MySQL still creates a table called $num and doesn't replace the
variable $num but its value like I wish.

I also tried:
$sql_query="CREATE TABLE $num (variable DATE NOT NULL)";
but without success.
I feel that I tried every possible combiantion without success. There
must be a solution. But what is it?
Received on Mon Oct 24 02:08:47 2005