Hi.

I prefer doing like this
$query = "CREATE TABLE query ";
$query .= "tabledef for col a,";
$query .= "tabledef for col b,";
$query .= "lots more table defs,";
$query .= "welcome to line 400";

You get the point i guess
you can do same things many different ways in php:)

/PM\

Alex Aulbach wrote:
> 
> Yesterday, from Nathan:
> 
> > Since PHP ignores whitespace, I think this is also acceptable:
> 
> PHP doesn't ignore whitespace in a quote. But your code is of course
> correct.
> 
> > $query = "CREATE TABLE query
> >   tabledef for col a,
> >   tabledef for col b,
> >   lots more table defs,
> >   .....
> >   welcome to line 400";
> 
> Another way: (without test)
> 
> $bladefault=24;
> $query = <<<eoq;
> CREATE TABLE query (
>   id    char(2) default "24" # doublequotes work
>   hugo  char(2) default '24' # singlequotes work either
>   bla   char(2) default '$bladefault' # inline vars work
> ...
> )
> eoq
> 
> --
> > How is possible to pass a long query to MySQL server with php?
> > I mean i.e a "create table" statement with more than 400 chars.
> > Have I to use shorter "create" and then "alter"?
> 
> Strings in PHP can be really, really long and are binary safe. Perhaps the
> problem is the editor?
> 
> --
> 
> SSilk - Alexander Aulbach - Herbipolis/Frankonia Minoris
> 
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
> 
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to