Jump to content


Photo

query is too long...can't send?


  • Please log in to reply
4 replies to this topic

#1 Alien

Alien
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 31 October 2003 - 06:22 AM

I have a 5000-character-long query.
I saved it in a textfile and sent it successfully in this way:
mysql> source myquery.txt

However, when I passed the query to the server in a php script, not the whole query was sent; only part of it was sent.
How can I fix it?

#2 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 31 October 2003 - 07:36 AM

Read this

http://www.mysql.com...Batch_mode.html

If you are running mysql under Windows and have some special characters in the file that cause problems, you can do this:

dos> mysql -e \"source batch-file\"


Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#3 Alien

Alien
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 31 October 2003 - 08:07 AM

Read this

http://www.mysql.com...Batch_mode.html

If you are running mysql under Windows and have some special characters in the file that cause problems, you can do this:

dos> mysql -e \"source batch-file\"


hmm...it is the same as what I post \"source filename\".
what can I do if I want to use a php script?

#4 shivabharat

shivabharat
  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 31 October 2003 - 08:53 AM

You may try like this

Ensure that the whole query is in a single line .

<?$contents = file("sql.txt"); while (list($qry) = each($contents)) { echo $contents[$qry];} ?>

Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#5 Alien

Alien
  • Members
  • Pip
  • Newbie
  • 9 posts

Posted 03 November 2003 - 07:36 AM

I think that u mis-understand my question....

I only have one query, which is a select statment.
But the select statement is too long, it contains about 6000 characters, so it can\'t pass through...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users