Nice to meet you. Thanks for your help.
I am new to the program, but the PHP version of the rental server has changed from 5 to 7, the mysql function can no longer be used, and is changing to mysqli.

The following is a part of the source that inserts data from CSV to MySQL, but it changes to php7 and it is an error that can not proceed. (Error at mysql_real_escape_string)

$query = sprintf (
    'INSERT INTO reins_data (% s) values ​​(% s);'
    , mysql_real_escape_string (implode (',', $cell_sql))
    , implode (',', $line_sql)

The above part certainly borrowed a part that was answered to the question in this StackOverflow, but in order to deepen the understanding of this time, I investigated each function in order It is a situation.

And here is the question, but mysql_real_escape_string is
If i change to mysqli_real_escape_string,


If i look at

etc., it is written that the argument is different, but what kind of contents will it be in the above case?

I don't know if I should disclose the current source to a certain extent, and only a part is shown, but I will disclose it if necessary.

I would appreciate any advice.
Thank you.


I didn't understand the question even after looking at the manual, but I reviewed the manual in a word from Mts10806.

As a result, it was solved, but it was too difficult to see the manual. In other words, it was solved as per the manual. Thanks to mts10806 for giving me the opportunity to review.