Getting a string from MySQL
#6

I have a simple house loading system, here is an adapted version with basic somments.

Код:
new query[300], rowstring[60];
mysql_query("SELECT * FROM `houses`");

new queryresult[300]; //This is the string we will use to store the data in, before we process it
mysql_store_result();

if(mysql_num_rows() > 0) { //If there are any rows then....
	while(mysql_fetch_row_format(queryresult, "|")) { //For each row of data
		mysql_fetch_field_row(queryresult, "FEILDNAME"); //Puts the string representation of 'FEILDNAME' into queryresult
		//Do somthing with the data

		mysql_fetch_field_row(queryresult, "FEILDINT"); //Puts the string representation of 'FEILDINT' into queryresult
		new AsInt = int:strval(queryresult);

		mysql_fetch_field_row(queryresult, "FEILDFLOAT"); //Puts the string representation of 'FEILDFLOAT' into queryresult
		new AsFloat = floatstr(queryresult);
	}
}

mysql_free_result(); // Free the results
Reply


Messages In This Thread
Getting a string from MySQL - by Luis- - 05.03.2012, 20:38
Re: Getting a string from MySQL - by Luis- - 05.03.2012, 21:10
Re: Getting a string from MySQL - by Luis- - 06.03.2012, 00:20
Re: Getting a string from MySQL - by MP2 - 06.03.2012, 07:50
Re: Getting a string from MySQL - by Luis- - 08.03.2012, 00:00
Re: Getting a string from MySQL - by Grimrandomer - 08.03.2012, 03:26
Re: Getting a string from MySQL - by Shabi RoxX - 08.03.2012, 05:30

Forum Jump:


Users browsing this thread: 1 Guest(s)