how to query a previous query
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
Hey guys! I have the following code and I can't seem to find a way to query my previous query because $row['name']; is not working... Here is part of my code:
\n";
echo "\n";
echo "Form Sub Category\n";$sql2 = "SELECT \* FROM forum\_cats WHERE admin < ?;"; if(!mysqli\_stmt\_prepare($stmt, $sql2)) { echo "SQL error"; } else { mysqli\_stmt\_bind\_param($stmt, "i", $admin\_user\_level); mysqli\_stmt\_execute($stmt); $result2 = mysqli\_stmt\_get\_result($stmt); while ($row = mysqli\_fetch\_assoc($result2)) { $row = $row\['id'\]; $sql3 = "SELECT \* FROM forum\_sub\_cats WHERE cid = ?;"; if(!mysqli\_stmt\_prepare($stmt, $sql3)) { echo "SQL error"; } else { mysqli\_stmt\_bind\_param($stmt, "i", $row); mysqli\_stmt\_execute($stmt); $result3 = mysqli\_stmt\_get\_result($stmt); echo "".$row\['name'\]."\\n"; while ($row2 = mysqli\_fetch\_assoc($result3)) { $selected = ($row2\['id'\] == $id) ? "SELECTED": ""; echo " ".$row2\['name'\]
-
Hey guys! I have the following code and I can't seem to find a way to query my previous query because $row['name']; is not working... Here is part of my code:
\n";
echo "\n";
echo "Form Sub Category\n";$sql2 = "SELECT \* FROM forum\_cats WHERE admin < ?;"; if(!mysqli\_stmt\_prepare($stmt, $sql2)) { echo "SQL error"; } else { mysqli\_stmt\_bind\_param($stmt, "i", $admin\_user\_level); mysqli\_stmt\_execute($stmt); $result2 = mysqli\_stmt\_get\_result($stmt); while ($row = mysqli\_fetch\_assoc($result2)) { $row = $row\['id'\]; $sql3 = "SELECT \* FROM forum\_sub\_cats WHERE cid = ?;"; if(!mysqli\_stmt\_prepare($stmt, $sql3)) { echo "SQL error"; } else { mysqli\_stmt\_bind\_param($stmt, "i", $row); mysqli\_stmt\_execute($stmt); $result3 = mysqli\_stmt\_get\_result($stmt); echo "".$row\['name'\]."\\n"; while ($row2 = mysqli\_fetch\_assoc($result3)) { $selected = ($row2\['id'\] == $id) ? "SELECTED": ""; echo " ".$row2\['name'\]
unfortunately your code nothing to do with C/C++/MFC... Maybe you will try to ask to some more appropriate forum?