Using import_users.php with MySQL

General support regarding TimeTrex, such as
configuring policies/taxes or processing payroll.
Locked
WhiteBird00
Posts: 5
Joined: Thu May 22, 2008 6:41 am
Location: Jacksonville, FL

Using import_users.php with MySQL

Post by WhiteBird00 »

I attempted to import a CSV file of employee information using import_users.php and I get an error from PHP that "This application failed to start because LIBPQ.dll was not found." LIBPQ.dll is part of the PostgreSQL Windows interface and should not be necessary for a MySQL configuration. Do I have my installation improperly set up (although TimeTrex seems to be working fine and I can manually enter employees)? Is there something in import_users.php that needs to be changed to point to MySQL?

Better yet, can I just use mysqlimport to populate the users table? If so, which other fields will I have to populate besides company_id, user_name, password, first middle and last names, birth_date, hire_date, sin, sex_id, default_branch_id, and employee_number?

I'm running TimeTrex 2.2.8 Standard on Windows 2003 Server with PHP 5.2.6 and MySQL 5.0.51b.

Thanks,
Chris
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

Yes, it appears that your PHP installation is not correct, probably only the CLI (command line interface) part of it, not your web server part, which is why the import script fails, but you can add employees through the web interface. PHP treats these two completely separate.

I would also guess that the PostgreSQL libraries were compiled into PHP and are not loaded as an extension, because otherwise PHP shouldn't be trying to load that LIBPQ.DLL at all.

Personally I would recommend using our automated installer rather the spending a bunch of time trying to figure out whats wrong with your installation.

You definitely should not manually manipulate the TimeTrex tables unless you are a TimeTrex developer, thats just asking for problems down the road. There is a lot more to it then just adding data through SQL, there are many related tables and fields that need to be properly populated that is much too difficult to do by hand.
WhiteBird00
Posts: 5
Joined: Thu May 22, 2008 6:41 am
Location: Jacksonville, FL

Post by WhiteBird00 »

Thanks Shaun. I removed and reinstalled PHP and now it runs without the error message.

However, it now says "Invalid Unique Column<br>" when it finishes. I have checked and ensured that there are no duplicate employee numbers in the file. Is there some other field (or fields) that it looks at for a unique key?
shaunw
Posts: 7839
Joined: Tue Sep 19, 2006 2:22 pm

Post by shaunw »

The command you are supplying it is incorrect, specifically the part after the "-u", its not a column that is supported to be unique.

If you paste your exact command here I can give you more specifics.
WhiteBird00
Posts: 5
Joined: Thu May 22, 2008 6:41 am
Location: Jacksonville, FL

Post by WhiteBird00 »

Thanks again Shaun. I realized that I was using the name of the employee number field from my CSV file rather than the field name from the database. Once I changed the command line to include "-u employee_number", it imported all records correctly.
Locked