Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Aug 2011
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Dumping Text File From PHP Script

    Please can someone assist, i'm trying to dump my mysql query to text file using php script, the file dumps perfect in mysql but get error when converting it into php script.

    [CODE]
    $query = "SELECT
    RPAD(ocs_action,4,' '),
    RPAD(ocs_company,2,' ')
    FROM ocs
    INTO OUTFILE $outputfile
    FIELDS TERMINATED BY '' ENCLOSED BY '' ESCAPED BY ''
    LINES TERMINATED BY '\n' STARTING BY '')";
    [CODE]

  • #2
    New Coder
    Join Date
    Apr 2013
    Posts
    39
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Your question is not clear, is it that you want to dump your selected query result as php script. that is doing a form of caching?.

  • #3
    New Coder
    Join Date
    Aug 2011
    Posts
    11
    Thanks
    3
    Thanked 0 Times in 0 Posts
    My apologies, the script generates a text file, when i run the script in mysql workbench, then the text file dumps 100%,

    what i would like to do instead of running from workbench, rather create a php script to perform dump the query into a text file.

    i receive the following error when i run the script from php:

    (MySQL server version for the right syntax to use near 'SELECT RPAD(ocs_action,4,' '), RPAD(ocs_company,2,' ') FROM ocs INTO O' at line 1)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •