MySQL] Error (0): Failed to exeute query. You have an error in your SQL syntax; check the manual that corresponds to you
#1

PHP Code:
                 new Query[300];
                 
format(Querysizeof(Query), "INSERT INTO `playerdata` (`age`, `gender`, `skin`, `country`, `email`, `score`, `money`) VALUES('%d', '%d', '%d','%s', '%s, '%d', '%d')",
                     
pInfo[playerid][Age],
                    
pInfo[playerid][Gender],
                    
pInfo[playerid][Skin],
                    
pInfo[playerid][Country],
                    
pInfo[playerid][Email],
                    
StarterLevel,
                    
StarterMoney);
                
mysql_query(Query);
            } 
Reply
#2

EDIT: As WopsS said, you also frogot to add a ' at 5th formator, i've done it so just replace your script with the one edited by me

You frogot to add pInfo[playerid[Score] and pInfo[playerid][Money]

Code:
                  
            new Query[300]; 
            format(Query, sizeof(Query), "INSERT INTO `playerdata` (`age`, `gender`, `skin`, `country`, `email`, `score`, `money`) VALUES('%d', '%d', '%d','%s', '%s', '%d', '%d')", 
            pInfo[playerid][Age], 
            pInfo[playerid][Gender], 
            pInfo[playerid][Skin], 
            pInfo[playerid][Country], 
            pInfo[playerid][Email], 
            pInfo[playerid][Score], 
            pInfo[playerid][Money], 
            StarterLevel, 
            StarterMoney); 
            mysql_query(Query); 
            }
Reply
#3

Quote:
Originally Posted by sheNdjze
View Post
You frogot to add pInfo[playerid[Score] and pInfo[playerid][Money]

Code:
                  
            new Query[300]; 
            format(Query, sizeof(Query), "INSERT INTO `playerdata` (`age`, `gender`, `skin`, `country`, `email`, `score`, `money`) VALUES('%d', '%d', '%d','%s', '%s, '%d', '%d')", 
            pInfo[playerid][Age], 
            pInfo[playerid][Gender], 
            pInfo[playerid][Skin], 
            pInfo[playerid][Country], 
            pInfo[playerid][Email], 
            pInfo[playerid][Score], 
            pInfo[playerid][Money], 
            StarterLevel, 
            StarterMoney); 
            mysql_query(Query); 
            }
This isn't a problem. The real problem is ' at 5th formator, he doesn't have it after it.
Add a ' after second string formator.
Reply
#4

Quote:
Originally Posted by WopsS
View Post
This isn't a problem. The real problem is ' at 5th formator, he doesn't have it after it.
Add a ' after second string formator.
Didn't noticed that, edited
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)