Business MYSQL help!
#1

Код:
stock LoadBiz()
{
	new query[300];
	for(new i=0;i<MAXBIZ; i++)
	{
		format(query, sizeof(query), "SELECT * FROM business WHERE IDBiz = %d LIMIT 1", i);
		mysql_query(OCP, query);
		BInfo[i][ID] = cache_get_field_content_int(0, "IDBiz");
		cache_get_field_content(0, "TenBiz", BInfo[i][Ten],OCP,128);
		BInfo[i][Gia] = cache_get_field_content_int(0, "Gia");
		BInfo[i][Loai] = cache_get_field_content_int(0, "Loai");
		BInfo[i][X] = cache_get_field_content_float(0, "X");
		BInfo[i][Y] = cache_get_field_content_float(0, "Y");
		BInfo[i][Z] = cache_get_field_content_float(0, "Z");
	}
	return 0;
}
I got this error! Pls help me. , i use the new MYSQL R33.

Quote:

[14:49:44] [ERROR] CMySQLResult::GetRowDataByName() - invalid row index ('0')
[14:49:44] [ERROR] cache_get_field_content_float - invalid datatype

Reply
#2

I think there's something wrong with your actual mysql database and the table. You'd need to access phpmyadmin and fix it through that.
Reply
#3

Код:
format(query,sizeof(query),"CREATE TABLE IF NOT EXISTS business (\
	IDBiz int(11) NOT NULL,\
	TenBiz varchar(40) NOT NULL,\
	Gia int(11) NOT NULL,\
	Loai int(11) NOT NULL,\
	X float(11) NOT NULL,\
	Y float(11) NOT NULL,\
	Z float(11) NOT NULL)");
mysql_query(OCP, query);
Here.
Reply
#4

Close! I fixed it !
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)