Jump to content

Undefined offset: 0


yosra

Recommended Posts

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 

Link to comment
https://forums.phpfreaks.com/topic/276911-undefined-offset-0/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.