i've one csv file which consists of library group and it is data...

group consider as sheet as well as for each sheet consists of phrase title and phrase value...

I wish to place this csv data to 2 different table using mysql how do i ?

suppose i've 2 table like

phrase_library_group
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| GROUP_ID    | bigint(20)   | NO   | PRI | NULL    | auto_increment |
| GROUP_NAME  | varchar(100) | NO   |     | NULL    |                |
| ------------+--------------+------+-----+---------+----------------+

phrase_list
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| PHRASE_ID   | bigint(20)   | NO   | PRI | NULL    | auto_increment |
| PHRASE_NAME | varchar(100) | NO   |     | NULL    |                |
| PHRASE_DESC | varchar(500) | NO   |     | NULL    |                |
| GROUP_ID    | bigint(20)   | NO   | MUL | NULL    |                |
| ------------+--------------+------+-----+---------+----------------+

within image Additional_meds/Antibiotic Alerts/... are groups

and every group consists of different phrases..like Additional_meds consists of total 12 records as see below.

csv like enter image description here

Get it done natively in MySQL, this ought to be considerably faster and consume less ressources. Produce a table in MySQL that contains all fields out of your CSV, i.e.

tmp_phrases
+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| GROUP_NAME  | varchar(100) | NO   |     | NULL    |                |
| PHRASE_NAME | varchar(100) | NO   |     | NULL    |                |
| PHRASE_DESC | varchar(500) | NO   |     | NULL    |                |
| ------------+--------------+------+-----+---------+----------------+

load data from CSV into this table via LOAD INFILE statement inside MySQL, i.e.

LOAD DATA INFILE '~/phrases.csv' INTO TABLE tmp_phrases FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"';

Then you're able to split your computer data with two INSERT claims.

INSERT INTO phrase_library_group (GROUP_NAME)
    SELECT DISTINCT GROUP_NAME FROM tmp_phrases

INSERT INTO phrase_list (PHRASE_NAME,PHRASE_DESC,GROUP_ID)
    SELECT x.PHRASE_NAME,x.PHRASE_DESC,y.GROUP_ID
    FROM tmp_phrases x
    INNER JOIN phrase_library_group y ON x.GROUP_NAME=y.GROUP_NAME

Use: file_get_content() to see the file.

Use: explode() to parse the information thus fetch into arrays after which place using whatever mysql functions/classes you're using.

See: Insert comma separated records in table - For additional help