hi,

I tried to run a mysql script named out.txt, placed in the directory C:\mysql\bin. I have tested the script directly in mysql, from command prompt, and everything is OK, the script run without errors.

I wrote in a .php file the following lines:

mysql_connect("localhost");
mysql_unbuffered_query(". out.txt");

I got an error message, which said that I had a syntax error in line 2, and to check the manuals .....

I tried to use the full path "C:\mysql\bin\out.txt", to escape the back-slash character "\.out.txt", but the same error occured.

Can anybody help me? Thanks in advance.

    Try to put this query into a variable to see (echo) what php is doing.

      Olaf, thanks for answering, but I don't understand what you said exactly.
      to made an assignment:
      $var = "\. out.txt";
      echo $var;
      ?

      or to run the mysql_query() with the variable:
      mysql_query($var);

      I expected to be a function which executes a statment and doesn't return a table-format value. Something like odbc_exec(), which executes a sql-statement

        um I might be missing something but shouldnt you read from the text file an then execute the queries that are in itπŸ˜•

          No, you execute the script, not read from it. And I want to execute from php. mysql doesn't include stored procedures, so your only chance are these script files.

            Write a Reply...