MySQL Forums
Forum List  »  PHP

Re: Query not working on php, but does work in workbench
Posted by: Peter Brawley
Date: August 28, 2015 01:55PM

Use the nysqli API. The mysql API is deprecated and will be removed.

All calls that can throw errors need error handling---at a bare minimum, something like ...

$conn = mysqli_connect($host,$user,$password,$db) or exit( mysqli_connect_error() );
...
$res = mysqli_query($conn,$sql) or exit( mysqli_error($conn) );

If the result diff persists after you make those changes, add ...

echo $sql;

before the mysqli_query() call, and paste the runtime result it displays back into WorkBench.

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.