用破折号创建对象名称

I am trying to run a mysqli query to retrieve a single result, but it requires me to create an object that contains a dash in the name, so it won't work.

$style_name = $db2->query("SELECT ModelDesc-ENU FROM tlkpModel WHERE ModelID = '$style' LIMIT 1")->fetch_object()->ModelDesc-ENU; 

Notice the part fetch_object()->ModelDesc-ENU;- It's an invalid object name. How do I get around this?

Wrap the property in curly braces and quotes:

fetch_object()->{'ModelDesc-ENU'};

Although I suspect you also need to wrap the column name in ticks, too, as the dash is not a valid identifier characters and actually means you are subtracting ENU from ModelDesc.

$style_name = $db2->query("SELECT `ModelDesc-ENU` FROM tlkpModel WHERE ModelID = '$style' LIMIT 1")->fetch_object()->{'ModelDesc-ENU'};