Results 1 to 3 of 3

Thread: COUNT > MYSQL

  1. #1
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts

    COUNT > MYSQL

    how create a request?
    PHP Code:
    SELECT COUNT(killszomFROM table WHERE killszom > (SELECT killszom FROM table where login "username"
    working in phpMyAdmin but not in game.

    PHP Code:
    sql "SELECT COUNT(killszom) FROM `table` WHERE `killszom` > SELECT killszom FROM `table` WHERE `login` ='" self.pers["loginname"] + "'";
    mysql_query(level.mysqlsql);
    result mysql_store_result(level.mysql);
    row mysql_fetch_row(result);
    self.ebloebanoe=row[0];
    self iprintlnbold(self.ebloebanoe); 
    - this crash

  2. #2
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    add () around your subquery in cod, just like you did in phpadmin.

    Why do you think a query works in phpmyadmin allows you to remove some braces?
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  3. The Following 2 Users Say Thank You to IzNoGoD For This Useful Post:

    kung foo man (3rd April 2016),Paho (3rd April 2016)

  4. #3
    Private Paho's Avatar
    Join Date
    Feb 2014
    Location
    Russia
    Posts
    101
    Thanks
    43
    Thanked 48 Times in 37 Posts
    thanks, it works now

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •