Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8040621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:57:33+00:00 2026-06-05T03:57:33+00:00

I coded a SQL parser that load data from a MySQL dump. The problem

  • 0

I coded a SQL parser that load data from a MySQL dump. The problem is that some SQL statements contain semicolon themselves so my parser take it as EOL as I use

$sqlRows = explode(';', $sqlFile);

to parse the dump file.

Any suggestion on how to manage this? I’m stuck :S

edit:

Sorry I forgot to say that the problem is that when PHP writes data to DB from the dump file, it returns me an error when it read the sentence that contain the semicolon.

I know it’s not a full parser, it just read line by line. I’m new to this. I just need to “clone” the same DB (via dump file) to many, changing few data.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:57:34+00:00Added an answer on June 5, 2026 at 3:57 am

    try this

    $sqlRows=explode(";\n",$sqlFile);
    

    So you will only get the ; that are at the end of lines. However it’ll only work if your file is formatted with each statement finishing by a ; and each new statement beginning on a new line.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

These days, I use Flex & Bison generated some codes to develop a SQL-parser
I'm implementing a sql parser in lex and yacc, in that I use a
I have a lot of SQL insert/update/delete statements of which some are redundant. For
I am trying to import some data to SQL Server 2008 by means of
I need a php code and sql code that will let someone upload an
I have the following SQL code that runs against a Change Request database. Each
I normally use the following code in SQL Server: IF EXISTS (SELECT * FROM
I have the following data that basically I only need a few bits of
I've got the following JSON structure that defines a table and it's data. var
I've got some code that builds a map (graph) of rooms on a grid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.