MySQL Forums
Forum List  »  PHP

Re: Update mySQL row with PHP using sproc
Posted by: Peter Brawley
Date: June 03, 2020 08:45AM

> $result = "call sp_updatePerson ('$personId','$AddressL1')";

That just assigns the string "call sp_updatePerson ('$personId','$AddressL1')" to $result, doesn't do anything else.

You need something like ...

$result = mysqli_query( $link, "call(..." );

... but sprocs don't return values; if you want the result of the Update cmd, you need to poll that result and stuff it in an OUT param, see "Call procedure with OUT parameter" at https://www.artfulsoftware.com/infotree/mysqltips.php

And why bother at all with the sproc?, why not just make the update call straight from PHP?

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.