kernelgpf Posted July 21, 2008 Share Posted July 21, 2008 I'm getting this error- Operand should contain 1 column(s) From this code- $u_sql = mysql_query("SELECT id,name,ownerid,attack,defense,speed,luck,conformation,looks,strength,intelligence,(attack,defense,speed,luck,conformation,looks,strength,intelligence) AS total FROM ponies ORDER BY total DESC LIMIT 10")or die(mysql_error()); Help? Thanks! Link to comment https://forums.phpfreaks.com/topic/115774-operand-error/ Share on other sites More sharing options...
tibberous Posted July 21, 2008 Share Posted July 21, 2008 My guess, wrap the assignment in quotes. Link to comment https://forums.phpfreaks.com/topic/115774-operand-error/#findComment-595190 Share on other sites More sharing options...
kenrbnsn Posted July 21, 2008 Share Posted July 21, 2008 I don't believe you can have this (attack,defense,speed,luck,conformation,looks,strength,intelligence) AS total in the query. What are you trying to accomplish Ken Link to comment https://forums.phpfreaks.com/topic/115774-operand-error/#findComment-595194 Share on other sites More sharing options...
vikramjeet.singla Posted July 21, 2008 Share Posted July 21, 2008 as kenrbnsn said you can have one column in this at a time.... if want to sum than you have to use agreegate functions.... Link to comment https://forums.phpfreaks.com/topic/115774-operand-error/#findComment-595196 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.