Displaying values from a SQL count...


Posted on 16th Feb 2014 07:03 pm by admin

Hi,
Easy enough question i just forget the exact method ..
I have ...

Code: //count wins ...
$count_wins = mysql_query("SELECT count(*) FROM `matches`
WHERE result = 'W'
AND Player1_ID = $player1_val
AND Player2_ID = $player2_val ");


Then i want to display this :
Code: echo "<h2><b> Wins ". $count_wins . "</h2></b>" ;

But what is displayed is Wins Resource ID # 3

(or similar...)

How to i convert this php variable to a normal int?

becuase i didn't need to do this before in another query when i used to compare values .

No comments posted yet

Your Answer:

Login to answer
316 Like 30 Dislike
Previous forums Next forums
Other forums

remove a ; from emails in textarea
Code: <?php

session_start();

$database_host = "localhost&qu

How to store checkbox array in a session, and then be able to add to it?
I'm trying to store an array of checkbox values into a session array, sort of like a shopping cart,

first id from db not showing
I have a php script which displays the content of a mysql table as a html table with sorting, delete

disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte

User information
Hi All,
By using t-code SUIM we get all the user details,if suppose we donot have permission t

PHP doesn't send my mail
Hi all, I found this and used it to send mail. Simple contact form with some required fields. The va

Error: SQL Syntax; Line 1
Code:

<?php require "global_settings.php"; ?>
<title&g

Mouseover to edit (Ajax)
hi friends, can anyone help with the code behind to get this application working, please in VB (new

Echoing If Function?
A script I am using has If statements in the comments form to basically tell the form what to do. Cu

WORDPRESS - Multiple Loops Only Going to One Post?
I have various pages with multiple loops and i need them to be individual to all other categories.

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash