Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: Cool on Mar 07, 2017, 06:18 AM

Title: Query not working
Post by: Cool on Mar 07, 2017, 06:18 AM
else if ( cmd == "spawnwepdel")
    {

    if ( CheckTableSpawnwep( player ) )
    {
        mysql_query( sDB, "DELETE FROM SpawnWep WHERE lower(Nick)='" + player.Name.tolower() + "'" );
print(mysql_error(sDB));
        ClientMessage( "-> Your Spawnwep have been deleted.",player,255,0,102); SpawnwepPlayer[ player.ID ] = null;
    }
    else ClientMessage( "-> Error: You not have spawnwep.",player,255,0,102);
    }
error: Table 'database.SpawnWep' Does not exists
Title: Re: Query not working
Post by: Thijn on Mar 07, 2017, 07:46 AM
And what do you think that error means?
Title: Re: Query not working
Post by: KAKAN on Mar 07, 2017, 08:14 AM
Steps to correct:
1. Open your MySQL database using phpMyAdmin
2. Check whether the table is 'Spawnwep' or 'Spawnweps'
Title: Re: Query not working
Post by: Cool on Mar 07, 2017, 08:18 AM
Quote from: KAKAN on Mar 07, 2017, 08:14 AMSteps to correct:
1. Open your MySQL database using phpMyAdmin
2. Check whether the table is 'Spawnwep' or 'Spawnweps'
Spawnwep
Title: Re: Query not working
Post by: Cool on Mar 07, 2017, 08:24 AM
Quote from: Thijn on Mar 07, 2017, 07:46 AMAnd what do you think that error means?
The error mean is table not exists but table is exists :)
Title: Re: Query not working
Post by: Xmair on Mar 07, 2017, 09:23 AM
Quote from: happymint2 on Mar 07, 2017, 08:18 AM
Quote from: KAKAN on Mar 07, 2017, 08:14 AMSteps to correct:
1. Open your MySQL database using phpMyAdmin
2. Check whether the table is 'Spawnwep' or 'Spawnweps'
Spawnwep
Then try changing SpawnWep to Spawnwep. (If you're running the server in windows (http://stackoverflow.com/questions/6134006/are-table-names-in-mysql-case-sensitive))
Title: Re: Query not working
Post by: Cool on Mar 07, 2017, 09:56 AM
:P I did not notice this small mistake Thanks for pointing out