0

I am using the script found at this blog post.

What I am trying to do is output the SQL Code onto the screen and then using file_get_contents from my local web server to get the SQL Query and mysql_query it to my local database.

The problem is when I do this it gives me an error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO...

If I copy and paste the SQL Code from the screen it's executed perfectly fine.

I know this is quite a weird request but if someone could help me find the problem it'll be great.

1
  • Unfortunately not as it contains client information Commented Sep 24, 2011 at 2:47

1 Answer 1

1

well i used this

    $file = file_get_contents("db-backup-1316832550-6f1ed002ab5595859014ebf0951522d9.sql");
foreach(explode(';', $file) as $value => $key)
{
if($key == ''){continue;}

echo $key;
mysql_query($key) or die(mysql_error());
}

of course the file is example one

there's seems to be a problem with the delimiter = ";"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.