PDA

View Full Version : Accessing nxMyDB's database


gerard
09-30-2007, 11:37 AM
yep, that was it :-) now my users are being synced. a few questions though: if i wanted to write a quota script for your db, could i simply read out the monthup value from mysql? since its binary i would have to decode it somehow. and also, if i wanted to delete the user - could i just delete it from the mysql or would that cause him to be readded by the sites syncing?

neoxed
09-30-2007, 02:51 PM
Create, rename and delete operations are handled incrementally through the changes tables. Incremental syncs performed continually depending what you have the Sync_Interval set as.

If you want to create/rename/delete/change a user or group, it's best you do it through ioFTPD - not with the database directly.

gerard
10-01-2007, 02:32 AM
okay. this leaves me a bit in the rain ;x
if i wanted to implement a quota script on a remote box...
1) is there a way i can convert those binary month/weekup values into numbers?
2) if i by all means want to delete a user via the db - what is the exact command you are issuing from site? so i could maybe emulate it. i really dont want to have a multi site environment and still use one site as hub.

ADD:
neoxed: do you think you could give me a bit of inside-view on this topic? i'm really interested in the script - i just need to figure out a way to add a quota/trial script to your brilliant piece of scripting :-(

gerard
10-06-2007, 07:02 AM
i guess neoxed is working on something, so maybe someone else can help me..
some values in the mysql db are from type binary - now ive read that normaly you can convert those for viewing via the CHAR() function of sql - it doesnt work properly for me though. any idea on how i can convert e.g. the monthup field to a string that i can work with from tcl/bash? any help is appreciated!

neoxed
10-06-2007, 01:30 PM
I guess my subtle hint wasn't blatant enough.

If you want to create/rename/delete/change a user or group, it's best you do it through ioFTPD - not with the database directly.

You should never access the database directly. You can just as easily use one of ioFTPD's many available interfaces (shared memory, Tcl, module etc.).

I'm not condoning this because I don't want applications making internal changes for compatibility reasons. I reserve the right to change the way nxMyDB functions and I do not want to deal with third party scripts leaving disastrous errors all over the place.

The integers for credits and statistics arrays are stored in binary form (low order endianness). As far as I know, MySQL does not make a function available for reading binary integer values. The best you could do is write a stored procedure that would extract the number of bytes and use CAST to convert to integer or write a MySQL UDF in C/C++.

gerard
10-08-2007, 11:46 AM
okay, i understand your point. thanks for the reply.