Answer the question
In order to leave comments, you need to log in
After mysqli_connect(); gives the penultimate value, session reset?
Just PHP
=============================================== ============================
include ABSPATH . "/ns-connect.php";
$result = mysqli_query($connection, "SELECT * FROM `wp_ign_pay_info` ORDER BY `id` DESC");
// Getting product_id
$last_order = mysqli_fetch_assoc($result);
$product_id = $last_order['product_id'];
// Getting product_title
$query_product_title = mysqli_query($connection, "SELECT * FROM `wp_ign_products` WHERE `id` = $product_id");
$product_name = mysqli_fetch_assoc($query_product_title);
$project_name = $product_name['product_name'];
global $wpdb;
$latest_order = $wpdb->get_results("SELECT * FROM `wp_ign_pay_info` ORDER BY `id` DESC LIMIT 1");
$txn_id = $latest_order[0]->transaction_id;
$result = $wpdb->get_results("SELECT * FROM `wp_ign_pay_info` WHERE `transaction_id` = '$txn_id'");
$product_id = $result[0]->product_id;
$query_product_title = $wpdb->get_results("SELECT * FROM `wp_ign_products` WHERE `id` = $product_id");
$product_name = $query_product_title[0]->product_name;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question