I have following php code :
<?php
$connect = mysqli_connect("localhost","root", "","archit") or die("Couldn't connect to database");
$str = "SET @id := (SELECT ID FROM users where Name ='$u_name'); SELECT UID FROM useratt where ID = '@id';";
echo $str;
$query12 = mysqli_multi_query($connect,$str);
echo $query12;
while($row = $query12->fetch_assoc())
{
$str1 = "SET @UID := '".$row."';
SELECT AttributeValue FROM att_value where UID=@UID;
SET @AID := (SELECT AID FROM att_value WHERE UID=@UID);
SELECT AttributeName FROM att_name WHERE AID=@AID;";
echo $str1;
$query1= mysqli_multi_query($connect,$str1);
echo $row[0];
}
?>
I get the generic error but when I run the same code on MySQL then it works without error. Can someone please help me what am I missing .
I even tried exception handling but it didn't help.
NOTE : code fails in the while loop condition.