SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

Thread Tools Display Modes
Old 26/02/2010, 12:48 PM   #1
Big Clucker
Join Date: Jan 2010
Posts: 98
Reputation: 0
Default Counting with mysql queries

I made this to count how many houses i have, so i can make loop better.. First time the public works well, so it gives the right answer but if i run this public again it's answer is always zero..

public totalhouses()
	new query[64], Field[64];
	format(query, sizeof(query), "SELECT count(hsqlid) FROM `houses`");

	mysql_fetch_field_row(Field, "count(hsqlid)");
	totalhouses = strval(Field);

	format(query, sizeof(query), "Houses = %d",totalhouses);
 	return totalhouses;

Whats wrong here ?
actiwe is offline  
Old 26/02/2010, 01:10 PM   #2
Posts: n/a
Default Re: Counting with mysql queries

totalhouses = mysql_num_rows();
Old 26/02/2010, 02:36 PM   #3
Big Clucker
Join Date: Jan 2010
Posts: 98
Reputation: 0
Default Re: Counting with mysql queries

Yea, thanks WackoX . It helped me !
actiwe is offline  

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Little coding questions - For general minor queries 5 !damo!spiderman Scripting Help 4152 06/09/2020 02:02 AM
Counting gun amo? SMCentral Help Archive 4 28/01/2010 06:42 PM
SQL queries using GROUP BY Dabombber Help Archive 1 05/10/2009 07:47 PM
counting Sal_Kings Help Archive 2 12/05/2009 02:57 PM

All times are GMT. The time now is 06:37 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.