Raised This Month: $ Target: $400
 0% 

Few questions from idiot


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
LambdaLambda
AlliedModders Donor
Join Date: Oct 2010
Location: London
Old 10-23-2012 , 16:49   Re: String as a table in MySQL part
Reply With Quote #1

When i put the table name, then it works great. Saves data inside my database etc.
[PHP]Format(test, sizeof(test), "INSERT INTO fort(steamid, ingame) VALUES ('%s',1)", auth);[PHP] - it works.

But when i will put there %s, so it will look like this:
PHP Code:
Format(testsizeof(test), "INSERT INTO %s(steamid, ingame) VALUES ('%s',1)"tablenameauth); 
- then it doesn't work. Just like it was skipping.

Did you actually try to put a string as a table name? Or maybe there is other solution?

But i didn't told you why i need to easy change that table. It will be on more than one server, and i need to have a seperate table for each server.


Thanks for help, btw.

Last edited by LambdaLambda; 10-23-2012 at 17:01.
LambdaLambda is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 10-23-2012 , 17:38   Re: String as a table in MySQL part
Reply With Quote #2

Quote:
Originally Posted by LambdaLambda View Post
%s(steamid, ingame)
O_o i'm no professional when it comes to SQL, but i think there needs to be a space between the table name and the values column names..
Only other thing that i could recommend is that you make it FailState when it gets an error on the callback. and See what's happening.

Last edited by Mitchell; 10-23-2012 at 17:43.
Mitchell is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 10-23-2012 , 17:41   Re: String as a table in MySQL part
Reply With Quote #3

Quote:
Originally Posted by Mitchell View Post
but i think there needs to be a space between the table name and the values column names..
If database is not defined as "table "
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 10-23-2012 , 17:52   Re: String as a table in MySQL part
Reply With Quote #4

Quote:
Originally Posted by Root_ View Post
If database is not defined as "table "
Then shame on the code for:
1. not having a logical variable, thus making it harder to find the problem if you forget that space. and
2. for not even telling use the variable string he is inputting.
Mitchell is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode