I have a query in my code which looks like this
$edi_transaction_id = mysqli_query($conn, "SELECT a.edi_transaction_id FROM edi_transaction_detail a JOIN reference_number b JOIN edi_transaction c WHERE a.asn_number = '$asn_number' AND a.edi_transaction_id = c.edi_transaction_id LIMIT 1");
I would like to get the value of that query and store it in $edi_transaction_id variable. I already thought this would run because it is working correctly when done on the mysql database directly but when I integrate it in my code this is the error
<b>Catchable fatal error</b>: Object of class mysqli_result could not be converted to string in <b>/home/ationgzon/WebService/edi_864_824_files.php</b> on line <b>53</b><br />
This is the line number 53 in edi_864_824_files.php
mysqli_query($conn, "INSERT INTO `edi_864_824`(`edi_transaction_id`, `trading_partner`, `trans_date`, `issue`, `reference_number_id`) VALUES ($edi_transaction_id, '$trading_partner', '$trans_date', '$message', $reference_number_id)");
How do I do it so that I can insert it in my database.