Quantcast
Viewing all articles
Browse latest Browse all 5527

suneetpant on "How to run two queries one after another in php"

I have two mysql queries which i want to run. First query doesnot return anything but the second query runs perfectly. I am not able to figure out where I am wrong. As such kindly help :
Query 1 : [ Problem is defined as under: ]
Mysql query is :
'
$mid = trim($_SESSION['login_mail']);
$retrval = "select user_id from user_dtls where u_emailid='{$mid}'";
$result1=mysqli_query($connection, $retrval);
confirm_query($result1);
'
Soon after this query there is another one :
Query 2 : running perfectly.
'
$insertquery = "insert into utmp_orders (tord_dt, user_id, file_path, file_name, cat_id, pay_flag) values('{$curr_dt}',1,'{$filepath}','{$filename}',1,'N')";
$finalresult = mysqli_query($connection, $insertquery);
confirm_query($finalresult);
'
In the second query, the second value which is shown 1 is actually $result1. The second query runs only when the first query is removed.
I just can't figure out where I am wrong as the select statement which i have passed is ok. Pls help


Viewing all articles
Browse latest Browse all 5527

Trending Articles