MySQL Help
Alright, this is my first attempt at making a plugin that involves MySQL. Is everything here correct? It's not storing anything into the database.
Code:
|
a) I thought you knew how to code! ;-) If an array's size is 64, the parameter value should be 63. If the size is 32, the parameter should be 31. This goes for all of those get_cvar_* functions you use.
b) result = dbi_query(dbc,"INSERT INTO userinfo (name,steamid,ip,num) values ('%s','%s','%s')",name,steamid,ip,num) Count the number of of %s. Count the name of extra parameters at the end. |
Who is to say I coded that part? ;)
Anywho, I updated the above code slightly.. I made it into a command and put a bunch of console_print() functions in there to test it out. It doesn't print anything into console.. Any help? |
I use log_amx for testing to make sure I see the results. I have written a few SQL plugins if you want to look through my code. Noy saying I did it the best way, but it works well.
|
Do you see anything wrong?
|
These are set in the sql.cfg so these are not needed
Code:
Why is the IP 48? connects is not a database Code:
I am assuming you are using the num field to track connects? Code:
you declare new ip[64] but use %d to try and store it Also, you do not need to assign a value "num[31] = 1", just use a 1 instead of %d with a replace Code:
I will look through it more later when I am awake and don't have a baby on my lap |
48?
Anywho.. Code:
Because in PHP, I select it from a table like so: Code:
|
This is how I would have done it.
Code:
and the 48 comment is about this: you declare the ip as "new ip[64]" but you create a db field that is "`ip` VARCHAR( 48 ) NOT NULL," |
Don't you mean..
Code:
|
yes, sorry
|
| All times are GMT -4. The time now is 09:59. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.