![]() |
SQL problems
Hey, i've never really used sql before, i've tried but to no avail.
What im asking for is a query that will add a new section to the table (preferablly called "coins") and 2 functions which are Get and Set for the coins. So for example, every member has a coins section (just like posts) and 2 functions like: function Get takes userid returns coinsamount function Set takes userid, coinsamount. I'm really having trouble doing this, any help appreiciated. |
Quote:
[sql]alter table tablename add column coins int(11);[/sql] getter [sql]select coins from tablename where userid=something[/sql] setter [sql]update tablename set coins=something where userid=somethingelse[/sql] |
Thanks so much, exactly what i needed.
EDIT: I'm having problems, i tried this code: PHP Code:
Whenever i try the page it returns "Resource id #16". |
query_read_slave sets the database object with a cursor, it does not return the actual values.
also when not doing a select you should use query_write. (I think...dont quote me on this one) PHP Code:
|
Quote:
|
Thanks alot guys, its working now.
|
All times are GMT. The time now is 08:45 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|