Just a comment: Doing so it's possible to insert a line between $query...... statements. (comments ecc) Its very simple to write it with copy+paste and I prefer this. Thanks.
PS. I'll check the string limit and I let you know. I think it has to be the 64KB. I think only Visual Basic has this high limit, no? Makis > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, February 08, 2002 3:03 AM > To: Nathan > Cc: MySQL > Subject: Re: long query on php > > > 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 > --------------------------------------------------------------------- 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