Few questions from idiot
Hey,
i've done my own plugin. The idea is, to work with MySQL database. To insert, select etc. data into/from it. Everything was goig right until i had to seperate the servers somehow. So i choosen the string option. Like, to put as a table name a string, which gets data from cVar. Ookay, so i've done it. PHP Code:
Quote:
|
Re: String as a table in MySQL part
%t should be %s in your Format line or you're missing arguments for your translation phrase.
Weird, I made a similar mistake in a test plugin just the other day. |
Re: String as a table in MySQL part
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:
Did you actually try to put a string as a table name? Or maybe there is other solution? :P 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. |
Re: String as a table in MySQL part
Add two single quotes in a string. Should looks like '%s'
A tip: in dbi stuff you should quote strings, however, no need to do it for float, bool or integer |
Re: String as a table in MySQL part
Quote:
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. |
Re: String as a table in MySQL part
Quote:
|
Re: String as a table in MySQL part
Quote:
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. |
Re: String as a table in MySQL part
Okay guys. Sorry for not answear, my work didn't allow me for it. I did it, that was only a fucked up string.
PS there's quotes like this ' ' doesn't work in MySQL, you have to use ` `. That's why i had a little mish mash in my head, because i did try quotes, but the first ones. :D Now, to not opening new topic will ask shortly. I did download that plugin http://forums.alliedmods.net/showthread.php?p=1824790 (version light). And i did try to change it. It works like that, if i have buyed a slot, then that menu dont allow me to buy a slot again, because it says me the rest of my slot's time. It's okay, but i did try to change it. That what i wanted to do is to allow you to click a slot to buy, but if you already have it, it says you that. I thought it gonna work, but when compiling theres no others errors than one "Error 100: Function Prototypes do not match" And that what i've changed is: This: PHP Code:
PHP Code:
And this: PHP Code:
PHP Code:
|
Re: String as a table in MySQL part
Why did you change the prototype of MenuRS?
|
Re: Few questions from idiot
coz i'm idiot. Thanks. :D
One more, and last one. IMO, this should check if in table pfield_content is filled in field_11, and if it's client's steamid. And if there is filled in, to get member_id. And then if it has found steamid in there to send as a true, or if not to send as a false. The point is, it doesn't work. It do connects to database etc. And the error console says is "[0] Line 529, testytest.sp::ForumAccount()" PHP Code:
|
| All times are GMT -4. The time now is 11:44. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.