I am the only person to hold a gold badge in
on Stack Overflow and I am eager to show the right way for PHP developers.
Besides, your questions let me make my articles even better, so you are more than welcome to ask any question you have.
Click here to ask!
Please refrain from sending spam or advertising of any sort.
Messages with hyperlinks will be pending for moderator's review.
Markdown is now supported:
If you want to get a reply from admin, you may enter your Eómail address above
Thank you for your quick response. I did not receive an error. Just no output (verified through dev tools). When I replaced the '?' with an actual parameter still nothing. I then took out the prepared statement and tried a standard query and the output was perfect. It seems to be something in the way the prepared statement is looking at the "with recursive" query. Thank you.
Well, the response was not that quick, I have to admit, but I'll try my best.
As a rule, there is no difference for a prepared statement which query to run, but without the error message it is really poking in the dark.
Please refer to the following article in order to make sure you can see the error occurred: https://phpdelusions.net/articles/error_reporting
Hello. Your tutorial, examples, and code are extremely well put together and have worked for me every time! Thank you. I am having one problem and that has to do with a "with recursive" query. I cannot seem to make that work. Here is my code:
$sql_query = "WITH RECURSIVE child_mgmt_levels AS ( SELECT jobholder_uid, positionmgr_uid, position_level FROM positions WHERE positionmgr_uid = ? UNION ALL SELECT p.jobholder_uid, p.positionmgr_uid, p.position_level FROM positions p INNER JOIN child_mgmt_levels cml ON cml.jobholder_uid = p.positionmgr_uid ) SELECT jobholder_uid FROM child_mgmt_levels cml WHERE position_level > 1";$stmt = prepared_query($dbc, $sql_query, [$user_id]);$result_query = $dbc->query($sql_query);
What error does it show?