[Help]Creating Tables in PhpMyAdmin
#1

I'm new to MySql and PhpMyAdmin so I need help with creating tables. I use MySql and PhpMyAdmin from Volt-Host.

Код:
[04:58:33] >> mysql_query( Connection handle: 1 )
[04:58:33] CMySQLHandler::Query(SELECT `Username` FROM `accounts` WHERE `Username` = 'Rohan_Ubhare') - An error has occured. (Error ID: 1146, Table 'myDBname.accounts' doesn't exist)
So what to do now?

Thanks in Advance,
Rohan Ubhare
Reply
#2

Well.. Umm. Why are you selecting Username, when you know Username? Near username add 'ID' table, and do it like this:

Код:
format(sqlquery, 24, "SELECT `id` FROM `accounts` WHERE `username`='%s'", pName_(playerid));
+

Код:
stock pName_(pid)
{
    new n[24];
    GetPlayerName(pid, n, 24);
    return n;
}
By this you can easily check if an account exist in database.
Reply
#3

Nw the script won't compile
Reply
#4

Of course It won't. I just gave you a format function.

Код:
stock accExists(playerid)
{
    new sqlquery[100];
    format(sqlquery, 24, "SELECT `id` FROM `players` WHERE `login`='%s'", pName_(playerid));

    mysql_query(sqlquery);
    mysql_store_result();

    if(mysql_num_rows())
        return 1;

	mysql_free_result();

    return 0;
}
This is full function to see if player's acc exist.
Reply
#5

What you are trying to make btw?
Reply
#6

nvm -_- I no more use php/mysql. Thanks anyways
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)