Resource id #4 PHP MYSQL

前端 未结 6 1144
天命终不由人
天命终不由人 2020-12-22 12:59
    $result = mysql_query(\"SELECT indvsum.sum1 + indvsum.sum2
    FROM (SELECT SUM(Cash) AS sum1,
                 SUM(Bank) AS sum2
          FROM players) indvsum         


        
6条回答
  •  梦毁少年i
    2020-12-22 13:36

    This is the expected behavior.

    Please check out the manual for some example about how to fetch rows:

    mysql_query

    This is the signature:

    resource mysql_query ( string $query [, resource $link_identifier = NULL ] )
    

    For getting the rows you should use

    mysql_fetch_array

    or

    mysql_fetch_assoc

    for example.

提交回复
热议问题