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 ...

Did you know?Explore Trending and Topic pages for more stories like this.
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

Setting condidtions for an input box
Hi all,

I would like to set a condition in a txt box that says the number a user enters has t

writing my own sobel filter convolution - something is wrong
I am trying to keep it very simple, I cant see anything wrong with my logic, could anybody help poin

Fetching META TAGS through
Hello everybody
I want to fetch meta tags of a domain.
It will be done from following code of

getting rid of quotes in strings
sick of trying to deal with them in multiple ways (entering in and taking from database, echoing, ec

Best way to read this text file.
Hi.I am planning to make a small application in C# to convert the players from Football manager 2010

How to calculate days from variable date?
This will be easy for one of you gurus. I want to fetch the date from a variable date, for example:<

downloading a file as HTML
Hi.
I'm rather confused with forcing a download. I just want to save dynamic content (from $_SESS

Displaying Column Names
I have a question regarding the ability to show the column names from my table/query.
What I'm lo

Read from a text file after a specific word
Hi all.

I have a text file that looks like the one below.
I know how to open the text fi

Need a Timecode Class...
Not a Time Stamp, Time Code. Format is a bit different. HH:MM:SS:FF where FF is Frames. I dont re

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