MySql MultiLine Query doesn’t work?
-
I’m using the following query to get a users rank
$userPos = $wpdb->query("SELECT points INTO @score FROM wp_gameUsers WHERE id=1; SELECT COUNT(*) FROM wp_gameUsers WHERE points > @score;");
Executes fine as a standard mySQL query, but when I move it into wordpress to process it faults at the ‘;’.
WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘; SELECT COUNT(*) FROM wp_gameUsers WHERE points > @score’ at line 1]
Anyone have any idea of how to work around this?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘MySql MultiLine Query doesn’t work?’ is closed to new replies.