(MySQL) Add column if not exists?
#7

Quote:
Originally Posted by TheToretto
Посмотреть сообщение
There you go, if it exists, it'll return the value 1 which is true, else 0 which is false.

pawn Код:
CMD:alter(playerid, params[])
{
    new query[128];
    mysql_format(Database, query, sizeof(query), "SHOW COLUMNS FROM `sa-mp_test` LIKE 'column1'");
    mysql_tquery(Database, query, "ColumnCheck");
    return 1;
}

forward ColumnCheck();
public ColumnCheck()
{
    printf("It returned the value %d", cache_num_rows());
    return 1;
}
I love you <3



@corne I'll think about it


@Jefff Thank you too! (i understand your reply, but i didn't know how to implement it correctly)
Reply


Messages In This Thread
(MySQL) Add column if not exists? - by ByMatt20030 - 29.10.2018, 22:30
Re: (MySQL) Add column if not exists? - by TheToretto - 29.10.2018, 22:43
Re: (MySQL) Add column if not exists? - by ByMatt20030 - 29.10.2018, 23:01
Re: (MySQL) Add column if not exists? - by Jefff - 30.10.2018, 00:08
Re: (MySQL) Add column if not exists? - by corne - 30.10.2018, 07:07
Re: (MySQL) Add column if not exists? - by TheToretto - 30.10.2018, 07:22
Re: (MySQL) Add column if not exists? - by ByMatt20030 - 30.10.2018, 16:41

Forum Jump:


Users browsing this thread: 1 Guest(s)