MDanz 0 Junior Poster

I have to columns Positive and Negative. i use this as a rating system.

e.g. For example if Positive is value 2 and Negative is value 1 and i subtract.
Then the total would be 1.

i have a variable $order. if i did $order="(Positive-Negative)"; I now that is incorrect. But how do i do that so the query order's by the the total of (Positive-Negative) for a row.

$construct = "SELECT * FROM Stacks WHERE keywords='$search' AND ({$adult}) ORDER BY `$order` DESC";
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.