Anyone knows why my sql query doesn’t work after using a try catch function? the code is a regular code as I’m using every time and it works perfectly but when I try to use it after a try catch function it doesn’t work,
try{
//somecode
}
catch{
// somecode
}
$carType = 'ECAR';
$category = substr($carType,0,1);
if($category){
$querycy = ("SELECT * FROM carClassCodes where ClassC = '$category'");
$resultcy = mysql_query($querycy);
$rowcy = mysql_fetch_array($resultcy);
}
Thanks in advance.
Pay attention to the documentation. It clearly shows that
catchmust be followed by what type of error to catch. In its most basic form, it’scatch(Exception $e).