I run a non-profit association bulletin board using vBulletin software. I have been unable to find a vBulletin coder to help me with a MYSQL query. Seems straight forward to me. I have a csv email file of paid up association members. I also have vBulletin members/users who might or might not be association members. I want to run a query every quarter to compare the csv list to the BB members and any matches would be added to an addition usergroup for special website privalages. The additional user group could be zeroed out each time before running the query (or be part of the query).

If this is not the correct place to post this, could you please direct me to an appropriate venue.

Thank you,

Grant Sarver

Recommended Answers

All 3 Replies

Sounds like you know pretty much how you will go about it. I suggest that you create a temporary table (DROP if exists tablename first) and then run your query against that and the vBullletin tables. The command I think you want is mysqlimport:

mysqlimport --help
mysqlimport Ver 3.7 Distrib 5.1.39, for apple-darwin9.5.0 (i386)
Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL license

Loads tables from text files in various formats. The base name of the
text file must be the name of the table that should be used.
If one uses sockets to connect to the MySQL server, the server will open and
read the text file directly. In other cases the client will open the text
file. The SQL command 'LOAD DATA INFILE' is used to import the rows.

Usage: mysqlimport [OPTIONS] database textfile
(there is more).

You can also look online: http://dev.mysql.com/doc/refman/5.0/en/mysqlimport.html

No, I really don't know much, just some ancient stuff (ever here of DBase?). I have no idea how to go about this. And I sure can't risk my DB with tinkering. Possibly you could give me a clearer step-by-step and I could have a VB coder do it from there? Paid work is certainly a possibility. Or point me in the right direction. I just need someone who can do this. Thanks for your help griswolf!

I'm not a DBA. The steps for your or your person to take are:

  1. DROP TABLE IF EXISTS [I]sometemporarytable[/I]; /* just to be sure */
  2. Use mysqlimport from the command line OR write some code to read csv and insert into sometemporarytable
  3. Do your queries against existing and temporary tables, generating reports
  4. (Do some updates?)
  5. DROP TABLE [I]sometemporarytable[/I]; /* not strictly necessary */

If you want to do this by hand, then you can write a little cheat sheet to follow every time, loosely based on the list above. I think the effort and frequency is small enough to reasonably do it that way. The alternative is to write some script or executable that does the work every time: More initial effort, but it becomes a 'Push the big red button' effort after that, and can be done by anyone who needs the results without the need to be even semi-technical.

Yes, I have heard of DBase :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.