Re: long query on php
Here is how I do it: $query = some query ; $query.=some more of the same query ; $query.=still more query ; $query.=and so on... ; $rst = mysql_query($query); NOTE: you need to add a space at the end of each line (after the last word and before the closing quotations) if you plan on continuing the query on the next line, or else your SQL will be invalid. Good luck, Brett Original Message Follows From: savaidis [EMAIL PROTECTED] To: MySQL list \(E-mail\) [EMAIL PROTECTED] Subject: long query on php Date: Wed, 6 Feb 2002 21:13:44 +0200 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? Thanks Makis - 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 _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com - 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
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 ( idchar(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
RE: long query on php
Yesterday, from savaidis: The obious question is: (before I test it) This is concatenation to $query that is a string type, no? Yea. The following works either: mysql_query(create bla. bla. bla bla blabla . bla .bla ); So the limit isn't also set to 255 chars too? There is no such limit in PHP. Or is a trick especially for this case? There is no any bit nothing trick not. Read PHP-Doku about defintions of strings. -- 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
RE: long query on php
This may be due to 'max_allowed_packet' size ... have a look at http://www.mysql.com/doc/P/a/Packet_too_large.html This is configurable Regards, Dan. -Original Message- From: Alain Fontaine - Consultant and developer [mailto:[EMAIL PROTECTED]] Sent: Friday, 8 February 2002 1:30 a.m. To: 'MySQL list (E-mail)' Subject: RE: long query on php Have you tried just putting the querys into a variable and pass the var along to mysql_query() ? Did it not work? --- Alain Fontaine Consultant Developer VAlain S.A. Tel: +32-4-2522950 --- -Original Message- From: savaidis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 8:14 PM To: MySQL list (E-mail) Subject: long query on php 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? Thanks Makis - 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 - 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
RE: long query on php
Surprisingly it is mote than 64 KB! (I count strlen=74KB) Bravo!! Makis -Original Message- From: savaidis [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 9:08 AM To: [EMAIL PROTECTED]; 'Nathan' Cc: 'MySQL' Subject: RE: long query on php 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 ( idchar(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 - 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
RE: long query on php
Have you tried just putting the querys into a variable and pass the var along to mysql_query() ? Did it not work? --- Alain Fontaine Consultant Developer VAlain S.A. Tel: +32-4-2522950 --- -Original Message- From: savaidis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 8:14 PM To: MySQL list (E-mail) Subject: long query on php 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? Thanks Makis - 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
RE: long query on php
It shouldn't be a problem as long as the syntax is right... Gurhan -Original Message- From: savaidis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 2:14 PM To: MySQL list (E-mail) Subject: long query on php 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? Thanks Makis - 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
RE: long query on php
Or you could do it like this: $query=some query .some more of this query .still some more query .and so on and so forth...; ; The tabs are no needed, I just put them there to make it easy to understand that all those lines are actually just one line. - Johnny Withers [EMAIL PROTECTED] p. 601.853.0211 c. 601.209.4985 -Original Message- From: Brett Burgess [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 11:25 AM To: [EMAIL PROTECTED] Subject: Re: long query on php Here is how I do it: $query = some query ; $query.=some more of the same query ; $query.=still more query ; $query.=and so on... ; $rst = mysql_query($query); NOTE: you need to add a space at the end of each line (after the last word and before the closing quotations) if you plan on continuing the query on the next line, or else your SQL will be invalid. Good luck, Brett Original Message Follows From: savaidis [EMAIL PROTECTED] To: MySQL list \(E-mail\) [EMAIL PROTECTED] Subject: long query on php Date: Wed, 6 Feb 2002 21:13:44 +0200 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? Thanks Makis - 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 _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com - 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
Re: long query on php
Since PHP ignores whitespace, I think this is also acceptable: $query = CREATE TABLE query tabledef for col a, tabledef for col b, lots more table defs, . welcome to line 400; I have been using this technique and have not had any problems with it. If you echo $query, it's all on the same line. # Nathan - Original Message - From: Johnny Withers [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 07, 2002 10:36 AM Subject: RE: long query on php Or you could do it like this: $query=some query .some more of this query .still some more query .and so on and so forth...; ; The tabs are no needed, I just put them there to make it easy to understand that all those lines are actually just one line. - Johnny Withers [EMAIL PROTECTED] p. 601.853.0211 c. 601.209.4985 -Original Message- From: Brett Burgess [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 11:25 AM To: [EMAIL PROTECTED] Subject: Re: long query on php Here is how I do it: $query = some query ; $query.=some more of the same query ; $query.=still more query ; $query.=and so on... ; $rst = mysql_query($query); NOTE: you need to add a space at the end of each line (after the last word and before the closing quotations) if you plan on continuing the query on the next line, or else your SQL will be invalid. Good luck, Brett Original Message Follows From: savaidis [EMAIL PROTECTED] To: MySQL list \(E-mail\) [EMAIL PROTECTED] Subject: long query on php Date: Wed, 6 Feb 2002 21:13:44 +0200 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? Thanks Makis - 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 _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com - 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 - 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
RE: long query on php
There is no limit on the size of strings in PHP. Follow this link for more info: http://www.php.net/manual/en/language.types.string.php Brett Original Message Follows From: savaidis [EMAIL PROTECTED] To: 'Johnny Withers' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: long query on php Date: Thu, 7 Feb 2002 22:29:47 +0200 The obious question is: (before I test it) This is concatenation to $query that is a string type, no? So the limit isn't also set to 255 chars too? Or is a trick especially for this case? Makis -Original Message- From: Johnny Withers [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 7:36 PM To: [EMAIL PROTECTED] Subject: RE: long query on php Or you could do it like this: $query=some query .some more of this query .still some more query .and so on and so forth...; ; The tabs are no needed, I just put them there to make it easy to understand that all those lines are actually just one line. - Johnny Withers [EMAIL PROTECTED] p. 601.853.0211 c. 601.209.4985 -Original Message- From: Brett Burgess [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 11:25 AM To: [EMAIL PROTECTED] Subject: Re: long query on php Here is how I do it: $query = some query ; $query.=some more of the same query ; $query.=still more query ; $query.=and so on... ; $rst = mysql_query($query); NOTE: you need to add a space at the end of each line (after the last word and before the closing quotations) if you plan on continuing the query on the next line, or else your SQL will be invalid. Good luck, Brett Original Message Follows From: savaidis [EMAIL PROTECTED] To: MySQL list \(E-mail\) [EMAIL PROTECTED] Subject: long query on php Date: Wed, 6 Feb 2002 21:13:44 +0200 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? Thanks Makis - 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 _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com - 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 _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx - 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
RE: long query on php
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 ( idchar(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 - 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
Re: long query on php
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 ( idchar(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
RE: long query on php
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 ( idchar(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
RE: long query on php
Surprisingly it is mote than 64 KB! (I count strlen=74KB) Bravo!! Makis -Original Message- From: savaidis [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 9:08 AM To: [EMAIL PROTECTED]; 'Nathan' Cc: 'MySQL' Subject: RE: long query on php 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 ( idchar(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 - 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
RE: long query on php
Have you tried just putting the querys into a variable and pass the var along to mysql_query() ? Did it not work? --- Alain Fontaine Consultant Developer VAlain S.A. Tel: +32-4-2522950 --- -Original Message- From: savaidis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 8:14 PM To: MySQL list (E-mail) Subject: long query on php 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? Thanks Makis - 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
Re: long query on php
Here is how I do it: $query = some query ; $query.=some more of the same query ; $query.=still more query ; $query.=and so on... ; $rst = mysql_query($query); NOTE: you need to add a space at the end of each line (after the last word and before the closing quotations) if you plan on continuing the query on the next line, or else your SQL will be invalid. Good luck, Brett Original Message Follows From: savaidis [EMAIL PROTECTED] To: MySQL list \(E-mail\) [EMAIL PROTECTED] Subject: long query on php Date: Wed, 6 Feb 2002 21:13:44 +0200 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? Thanks Makis - 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 _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com - 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
RE: long query on php
The variable will be string of cource that contains nomore than 255 chars. No, I didn't even tried it :) (concatenation will be the same) But it has to be a way... It is a problem, because my internet MySQL base doesn't permmit me to login with MySQLfront as I have dynamic IP, for security and other reasons I can understand :) So is difficult to pass my local base's structure to my remote MySQL base. Makis -Original Message- From: Alain Fontaine - Consultant and developer [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 2:30 PM To: 'MySQL list (E-mail)' Subject: RE: long query on php Have you tried just putting the querys into a variable and pass the var along to mysql_query() ? Did it not work? --- Alain Fontaine Consultant Developer VAlain S.A. Tel: +32-4-2522950 --- -Original Message- From: savaidis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 06, 2002 8:14 PM To: MySQL list (E-mail) Subject: long query on php 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? Thanks Makis - 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
RE: long query on php
The obious question is: (before I test it) This is concatenation to $query that is a string type, no? So the limit isn't also set to 255 chars too? Or is a trick especially for this case? Makis -Original Message- From: Johnny Withers [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 7:36 PM To: [EMAIL PROTECTED] Subject: RE: long query on php Or you could do it like this: $query=some query .some more of this query .still some more query .and so on and so forth...; ; The tabs are no needed, I just put them there to make it easy to understand that all those lines are actually just one line. - Johnny Withers [EMAIL PROTECTED] p. 601.853.0211 c. 601.209.4985 -Original Message- From: Brett Burgess [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 11:25 AM To: [EMAIL PROTECTED] Subject: Re: long query on php Here is how I do it: $query = some query ; $query.=some more of the same query ; $query.=still more query ; $query.=and so on... ; $rst = mysql_query($query); NOTE: you need to add a space at the end of each line (after the last word and before the closing quotations) if you plan on continuing the query on the next line, or else your SQL will be invalid. Good luck, Brett Original Message Follows From: savaidis [EMAIL PROTECTED] To: MySQL list \(E-mail\) [EMAIL PROTECTED] Subject: long query on php Date: Wed, 6 Feb 2002 21:13:44 +0200 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? Thanks Makis - 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 _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com - 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
RE: long query on php
There is no limit on the size of strings in PHP. Follow this link for more info: http://www.php.net/manual/en/language.types.string.php Brett Original Message Follows From: savaidis [EMAIL PROTECTED] To: 'Johnny Withers' [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: RE: long query on php Date: Thu, 7 Feb 2002 22:29:47 +0200 The obious question is: (before I test it) This is concatenation to $query that is a string type, no? So the limit isn't also set to 255 chars too? Or is a trick especially for this case? Makis -Original Message- From: Johnny Withers [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 7:36 PM To: [EMAIL PROTECTED] Subject: RE: long query on php Or you could do it like this: $query=some query .some more of this query .still some more query .and so on and so forth...; ; The tabs are no needed, I just put them there to make it easy to understand that all those lines are actually just one line. - Johnny Withers [EMAIL PROTECTED] p. 601.853.0211 c. 601.209.4985 -Original Message- From: Brett Burgess [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 11:25 AM To: [EMAIL PROTECTED] Subject: Re: long query on php Here is how I do it: $query = some query ; $query.=some more of the same query ; $query.=still more query ; $query.=and so on... ; $rst = mysql_query($query); NOTE: you need to add a space at the end of each line (after the last word and before the closing quotations) if you plan on continuing the query on the next line, or else your SQL will be invalid. Good luck, Brett Original Message Follows From: savaidis [EMAIL PROTECTED] To: MySQL list \(E-mail\) [EMAIL PROTECTED] Subject: long query on php Date: Wed, 6 Feb 2002 21:13:44 +0200 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? Thanks Makis - 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 _ Join the world's largest e-mail service with MSN Hotmail. http://www.hotmail.com - 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 _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx - 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
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 ( idchar(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
RE: long query on php
Yesterday, from savaidis: The obious question is: (before I test it) This is concatenation to $query that is a string type, no? Yea. The following works either: mysql_query(create bla. bla. bla bla blabla . bla .bla ); So the limit isn't also set to 255 chars too? There is no such limit in PHP. Or is a trick especially for this case? There is no any bit nothing trick not. Read PHP-Doku about defintions of strings. -- 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
Re: long query on php
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 ( idchar(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