dmx1 Posted May 23, 2019 Share Posted May 23, 2019 Hi Larry, I wrote the following code: $r = mysqli_query($dbc, "CALL get_users_info_from_carts('$uid')"); if (mysqli_num_rows($r) > 0) { while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) { if ($row['users_id'] == '0') { $usr_id = $_SESSION['user_id']; mysqli_query($dbc, "CALL add_user_to_cart('$uid', $usr_id, '$e')"); } } } The CALL add_user_to_cart('$uid', $usr_id, '$e') function is suppose to update the carts table, but for some reason, no update is happening. I ran the scripts directly through phpmyadmin and they are executing fine, but for some reason, the code above is not generating an update. mysqli_query() is not executing the stored procedure. Is there anyting that you see that may be a problem? Can you help please. Thanks Link to comment Share on other sites More sharing options...
Larry Posted May 23, 2019 Share Posted May 23, 2019 There's nothing obvious in the code that's wrong. You'll need to do some debugging here. Start by verifying that the stored procedure is being called. Then verify the values of the variables. Run the stored procedure using phpMyAdmin (or the mysql client) using those same variable values, etc. In short, you'll need to use lots of print statements, trial and error, here! Link to comment Share on other sites More sharing options...
Recommended Posts