MySQL query in PHP no longer works

I took over the maintenance of this website and I only know the basic MySQL commands . When WordPress is updated to version 4.3.1, this request stops working. Until then, it worked fine.

The user enters information into the form, which is submitted to the MySQL database , it still works. Then the data is extracted from the completed form and sent by e-mail to the company. Email passes, but fields are blank.

'$query = "INSERT INTO ..._app (appid,$insert_keys) VALUES ('',$insert_values)";

mysql_query($query)
            or die(mysql_error());

$app_query = mysql_query("SELECT MAX(appid) AS appid FROM ..._app")
    or die(mysql_error());
$app_row = mysql_fetch_array($app_query);
extract($app_row);
$agent_msg = "...
    \n
    Application ID: $appid\n
    Borrower Information\n
    First Name: $fname\r
    Middle: $mname\r
    Last Name: $lname\r

... etc .. Yes, I know that this is MySQL, which is deprecated, but the client does not want everything to be rewritten at this time. It seems too coincidental that this stopped working when WordPress was updated. I am not sure if it is fixed in MySQL code.

+4
1

print_r ($ _ REQUEST) , . , WP :

global $wpdb;
$wpdb->insert( 'table name', array( 'field 1' => $_REQUEST['field 1'], 'field 2' => $_REQUEST['field 2']));
0

Source: https://habr.com/ru/post/1611145/


All Articles