I haven't really messed with $wpdb before, but I'm stuck hard on one part. I'm trying to get the values returned in an associative array.
I've tried both of these
$datarow = $wpdb->get_results("SELECT class_name FROM wp_wcs2_class WHERE id=$classnumber");
$datarow = $wpdb->get_results("SELECT class_name FROM wp_wcs2_class WHERE id=$classnumber",ARRAY_A);
but print_r $datarow;
just errors out with Parse error: syntax error, unexpected T_VARIABLE
Any idea what's going wrong? I know the data is there because this returns the correct value:
$nameresult = $wpdb->get_var($wpdb->prepare("SELECT class_name FROM wp_wcs2_class WHERE id=$classnumber",ARRAY_A));