Home › Forums › Back End › php variables › Reply To: php variables
June 1, 2014 at 11:02 am
#171538
Participant
can you say the way to escape in that php pdo wrapper class??
The wrapper class you’re using extends
PDO, so it already has the quote
method. You can “just use it.”
Ok thanks for the advice and while binding if user inputs invalid error how to display it???
PDO uses exceptions by default, so you can just wrap your code in a try…catch block. PDO exceptions can contain sensitive information (including DB credentials), so be sure you don’t show them on the “live” site.
try{
$DB->somethingThatMightCauseAnError();
}
catch( PDOException $PDOe ){
if ( $youAreDebugging ){
echo $PDOe->getMessage();
}
else{
echo "<p>sorry, something went wrong.</p>";
}
}
and i got all the great answer so how to close this thread
Can’t close. Don’t worry about it.