SQLx help again :P
So basically, what I'm looking for is a way to store multiple values in a single field, and a way to read only the values I need from that field. An example field:
Code:
1337|57|96|48|32 |
Re: SQLx help again :P
Why can't you use multiple fields?
|
Re: SQLx help again :P
Because it would look like shit. You think I haven't thought of that?
|
Re: SQLx help again :P
Not sure what you mean but I wouldn't do that. If I am going to be managing each value separately, I would save them to a field by itself. The only reason why I would save it all to one field is if I using it for history purposes only. Personally, I would find that it looks much nicer if it was in separate fields, but it is your plugin after all.
If you really want to do this, you can use strtok |
Re: SQLx help again :P
What I do whenever I need that functionality is just build the table as a keytable. Then I have two fields:
Code:
key | valueCode:
key | value |
Re: SQLx help again :P
Hawk, you're familiar with Harbu's plugins, right? You've seen the items table and such right? I'm trying to do something like that, but I really don't want to dig through Harbu's horrible code.
|
Re: SQLx help again :P
Quote:
Check it out; it's in my sig. |
Re: SQLx help again :P
I know about ARP, I've just never run a server with it. Never cared to. I guess I'll check it out, but I hate combing through other people's code just for something simple...
Edit: I'm not gonna look through all of that... |
Re: SQLx help again :P
If you're trying to write something for a TSRP server, ARP is probably the better way to go because it has a complete API making it easier to develop stuff. The thing you're trying to do can probably be automated by the natives supplied in the data layer, so you'll never need to access the SQL database. The data layer is an API which allows you to manipulate and save a keytable into SQL automatically. My description may be simplifying it because it does much more than that, but that's all you really need to know for now. If you're interested or want to know more about it, feel free to post on the ARP board.
EDIT: Your loss. I tried to help. It's the best solution, but if you want to make more crap code like Harbu then be my guest. |
| All times are GMT -4. The time now is 09:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.