when i try to execute this code i always have a problem . and i can't get the element i m searching for in the database
//select the CODE from nxcp_code
$sql= "select value from nxcp_code where name = '$name'" ;
$res=mysql_query($sql);
if( !$res ) {throw new Exception(mysql_error(),mysql_errno());}
$codeArray = mysql_fetch_assoc($res); //This fetch the first row of the result to an array with numeric indexes.
if( !$codeArray ){ throw new Exception('Code not found');} //somevhere you should catch it
$code =$codeArray[0];
any help please thanks in advance