26.04.2011, 22:20
How can I add it to my website so the players can log in with their IG names instead creating a new account on the website and logging in with it? Is this possible?
mysql_connect Use this function to connect to the mysql database. Parameters: (const host[], const user[], const pass[], const db[], auto_reconnect, MySQL:handle)const host[] The address of the mysql database. |
Parameters: (const host[], const user[], const pass[], const db[], MySQL:handle, auto_reconnect)const host[] The address of the mysql database. |
|
MySQLFetchAcctRecord(PlayerInfo[playerid][pSQLID], Data);
for (new rcnt = 0; rcnt < mysql_num_fields(); rcnt++)
{
mysql_fetch_field_num(rcnt, Field, MainDB);
// The rcnt values here represent the order of the columns in the characters table, so don't mess with them
// If you add a column to the table, just add a new line with a +1 rcnt to the block below
// Start it at 3 to skip the first few records we don't need (id, player name, password)
if (rcnt == 3) PlayerInfo[playerid][pLevel] = strvalEx(Field);
MySQLFetchAcctRecord(PlayerInfo[playerid][pSQLID], Data);
samp_mysql_strtok(Field, "|", Data);
while (samp_mysql_strtok(Field, "|", "")==1)
{
// The rcnt values here represent the order of the columns in the characters table, so don't mess with them
// If you add a column to the table, just add a new line with a +1 rcnt to the block below
// Start it at 3 to skip the first few records we don't need (id, player name, password)
if (rcnt == 3) PlayerInfo[playerid][pLevel] = strvalEx(Field);
[MySQL] Error (0): Function: mysql_connect failed, mysql was not initialized on this handle.
Error (0): Failed to connect. Access denied for user 'root'@'localhost' (using password: YES).
1 - is success 0 - is failed
mysql_strtok(Field, "|", Data); while (mysql_strtok(Field, "|", "")==1)
Could anyone tell me how to fetch multiple rows using this plugin?
|
mysql_store_result( mysql_connection_id ); for( new index = 0; index < mysql_num_rows( mysql_connection_id ); index++ ) { new row[ 256 ]; mysql_fetch_row_format( row, "|", mysql_connection_id ); // Whatever you want to do with this row. } mysql_free_result( mysql_connection_id );