MYSQL QUERY
#1

Hi,

SELECT * FROM gangsteritory WHERE uzimta = '2'

I want to get all fields, i want count them, all tables, where uzimta is 2.
Reply
#2

I'm not sure if I have interpreted the question correctly, but I'm guessing you want to count how many results that mysql query will give you? If so, I would use the following method:

pawn Код:
mysql_query("SELECT * FROM gangsteritory WHERE uzimta = '2'");
mysql_store_result();
new resultcount = mysql_num_rows();
The amount of results is store into the variable resultcount.

If I've got the wrong idea, I'm very sorry!
Reply
#3

I like in my db like that:

uzimta = 1
uzimta = 1
uzimta = 1
uzimta = 1
uzimta = 2
uzimta = 2
uzimta = 2
uzimta = 2
uzimta = 2

Then i want to know how much uzimta is inserted in db where uzimta is 2, now it's 4 in my example
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)