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 8634379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:42:35+00:00 2026-06-12T09:42:35+00:00

<?php $str = INSERT INTO `f_part` (lname,fname,email) VALUES (‘tha’,’thia’,’thia@gmail.com’); ?> anyone could help me

  • 0
<?php 
$str = "INSERT INTO `f_part` (lname,fname,email)  VALUES ('tha','thia','thia@gmail.com')";
?>

anyone could help me to convert this string to be an array

$result = array('table'=>'f_part',
                'data'=>array('lname=>'tha','fname=>'thia','email'=>'thia@gmail.com')

            )
  • 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-12T09:42:36+00:00Added an answer on June 12, 2026 at 9:42 am

    You need to analyze the query by looking for different MySQL keywords such as INSERT, SELECT, INTO, VALUES, FROM, WHERE, etc. However, this can get tricky and hard because you have to watch out to for single quotes, escape characters, etc.

    I suggest you just use http://code.google.com/p/php-sql-parser/. The class already does the tricky parts. It’s not really the same as the output you want but it will provide you something similar, and even more.

    Here is an example query:

    SELECT STRAIGHT_JOIN a,b,c 
      from some_table an_alias
     WHERE d > 5;
    

    And the sample output:

    Array
    ( 
        [OPTIONS] => Array
            (
                [0] => STRAIGHT_JOIN
            )       
    
        [SELECT] => Array
            (
                [0] => Array
                    (
                        [expr_type] => colref
                        [base_expr] => a
                        [sub_tree] => 
                        [alias] => `a`
                    )
    
                [1] => Array
                    (
                        [expr_type] => colref
                        [base_expr] => b
                        [sub_tree] => 
                        [alias] => `b`
                    )
    
                [2] => Array
                    (
                        [expr_type] => colref
                        [base_expr] => c
                        [sub_tree] => 
                        [alias] => `c`
                    )
    
            )
    
        [FROM] => Array
            (
                [0] => Array
                    (
                        [table] => some_table
                        [alias] => an_alias
                        [join_type] => JOIN
                        [ref_type] => 
                        [ref_clause] => 
                        [base_expr] => 
                        [sub_tree] => 
                    )
    
            )
    
        [WHERE] => Array
            (
                [0] => Array
                    (
                        [expr_type] => colref
                        [base_expr] => d
                        [sub_tree] => 
                    )
    
                [1] => Array
                    (
                        [expr_type] => operator
                        [base_expr] => >
                        [sub_tree] => 
                    )
    
                [2] => Array
                    (
                        [expr_type] => const
                        [base_expr] => 5
                        [sub_tree] => 
                    )
    
            )
    
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a PHP class method to insert form values into mysql database
I have a mysqli/php code below where it is suppose to insert data into
I have a mysqli/php code below where it is suppose to insert data into
I have this SQL statement below INSERT into 2011_electricity ( date, energy, daynum) VALUES
I need to replace \b with \\b in php in order to insert into
I'm using PDO to insert a record (mysql and php) $stmt->bindParam(':field1', $field1, PDO::PARAM_STR); $stmt->bindParam(':field2',
I have an url like this: http://www.w3schools.com/PHP/func_string_str_split.asp I want to split that url to
I've got a typical problem when trying to insert a date into MySQL. The
I am trying to insert a description text field into the database. I was
Possible Duplicate: Best way to prevent SQL Injection in PHP I'm trying to insert

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.