directorypress theme error mysql_error() [closed]

Thanks all, I got it
I changed the code to be

 $SQL = "SELECT * FROM 
   ".$wpdb->prefix."orderdata
   WHERE cus_id='".$userdata->ID."' 
   GROUP BY order_id 
   ORDER BY autoid DESC"; 
$results = $wpdb->get_results($SQL);

That solved the issue

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)