15 Replies - 968 Views - Last Post: 23 July 2012 - 09:11 AM
#1
Locating a database that I didn't create
Posted 20 July 2012 - 12:14 PM
I'm new to a job and am trying to go through the old employee's files. There is PHP, Javascript, Access, VisualBasic, and a few others extensions I'm not familiar with. One of our main tools our company uses is run off of the guy's local server. He uses Uniform Server and it starts when the machine boots.
My question is: I am trying to add a person to the website so when they login on their work computer, the tool we use recognizes the login and gives a specific menu based on the user's credentials. The old work has this set up for people who worked here, but I cannot figure out how to add a new employee (including myself). How can a php page link to a database, or where should I be looking for this database? Is it going to be Access or MySQL or both? Is there a config file I can check?
All of his PHP pages contain Javascript and they look like they contain database connection code, but I'm not sure what table to look for or where to look.
Thanks in advance.
Replies To: Locating a database that I didn't create
#2
Re: Locating a database that I didn't create
Posted 20 July 2012 - 12:21 PM
#3
Re: Locating a database that I didn't create
Posted 20 July 2012 - 12:37 PM
I don't mean to sound stupid, but I've never had to sort through something this complicated and without notes or commentation (especially when I don't know what file leads to what).
Thanks
#4
Re: Locating a database that I didn't create
Posted 20 July 2012 - 12:48 PM
Start->run-> and type "msconfig" and hit enter. Look at the services and start up tabs.. see if anything jumps out as "db-ish".
Failing that just do a general file search for "database" or known Access file extensions..
#5
Re: Locating a database that I didn't create
Posted 21 July 2012 - 01:27 PM
#6
Re: Locating a database that I didn't create
Posted 21 July 2012 - 04:09 PM
Have a look in the taskbar to see if you can locate the Uniform Server taskbar item, and right click on it. It should show a popup like this:

Then click on phpMyAdmin, which is a nice MySQL interface program. In there, you'll be able to see the databases (on the left hand side). You may need to trawl through if there are a few, but my guess is theree will be one or two. Once you click on one, the left hand side will be replaced with links to the tables of that database. I'd be looking for a table with the name "Users" or similar.
After that, it's possibly a crapshoot as to whether you can jack yourself an account. You may need to INSERT a row in that table, or in other tables as well, which may be named something like "UserRights" or "UserRoles". Without knowing the schema, I can't help you too much there. Once you have superuser access, you might want to look at the webpages of the application to see if there is a UI where you can add users more easily/safely.
If you're still having trouble locating a Users table, post back and I'll whip you up a query to hit the INFORMATION_SCHEMA to mine out tables that reference anything containing "user".
This post has been edited by e_i_pi: 21 July 2012 - 04:11 PM
#7
Re: Locating a database that I didn't create
Posted 22 July 2012 - 01:21 PM
$rs = $conn->Execute("SELECT * FROM UserAuth WHERE UserName='$USERNAME' AND [Employee_Data2]=True");
while (!$rs->EOF) {
$HASPOWER2 = "TRUE";
$rs->MoveNext(); }
if($HASPOWER2=="TRUE"){
if(empty($tmpSHOW)||$tmpSHOW=="FALSE"){
#SHOW TOP DATA TO CHOOSE DATE OF DATA TO VIEW
echo "<tr class='r2'>";
echo "<td width=300 align='Left' colSpan=1>ACTIVE EMPLOYEES<br>";
echo "<select name='tmpAEMP' id='tmpAEMP'>";
echo "<option>OFF</option>";
echo "<option>NEW</option>";
$ACOUNT=0;
$rs = $conn->Execute("SELECT LastName,FirstName,MiddleName FROM Employees WHERE Status='EMPLOYED' ORDER BY LastName ASC");
Here is some example code. Yes it is Windows XP SP3. There is no icon in the taskbar. MSCONFIG shows MySQL running, as well as MySQL Server, and there is .bat file that shortcuts to the Uniform Server at startup. There is a MySQL Server 5.0 in 'Programs' and when I click on the command line client it asks for a password (no idea what it is). I do know for a fact that all information that all user data is stored in a Microsoft Access Database, such as inventory numbers. I just don't know if that is where the initial data is being pulled from when the program/website loads (if that makes sense.)
I can access localhost from a web browser though. There are links to phpMyAdmin, Apache Config, MySQL Server Config, etc.
Thanks for all the advice.
#8
Re: Locating a database that I didn't create
Posted 22 July 2012 - 02:05 PM
$conn
Where is this variable created? Search for $conn = new
#9
Re: Locating a database that I didn't create
Posted 22 July 2012 - 02:21 PM
#10
Re: Locating a database that I didn't create
Posted 22 July 2012 - 02:28 PM
$conn
are with
$rs = $conn->Execute
#11
Re: Locating a database that I didn't create
Posted 22 July 2012 - 02:36 PM
$myobj = new MyObject();
So, somewhere in the PHP code there will be reference to $conn = new ....
Since it's on Windows, have you tried text-indexing the folder where all the files are, so that you can do a text search across them? I find that extremely handy when developing on a Windows platform. There's an FAQ here on how to create and rebuild indexes on Win.
#12
Re: Locating a database that I didn't create
Posted 22 July 2012 - 07:14 PM
#13
Re: Locating a database that I didn't create
Posted 22 July 2012 - 07:21 PM
#14
Re: Locating a database that I didn't create
Posted 23 July 2012 - 07:37 AM
// Absolute path of our mdb file
$cur_dir = addslashes(dirname(__FILE__));
$db_file = "\\Software\\...\\DataGate.mdb";
// Establish the connection
$conn = new COM("ADODB.Connection") or die("Cannot start ADO" . odbc_errormsg());
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=****;Data Source=\\Software\\....\\DataGate.mdb;");
#$conn->Open("PROVIDER=Microsoft.Jet.OLEDB.3.2;DRIVER={Microsoft Access Driver (*.mdb)};USer ID=****;PWD=****;DBQ="("\\Software\\....\\DataGate.mdb;"));
// Absolute path of our mdb file
$cur_dir2 = addslashes(dirname(__FILE__));
$db_file2 = "\\Software\\....\\DataGate.mdb";
#$provider2 = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . $db_file; "UID=****;PWD=****;"
// Establish the connection
$conn2 = new COM("ADODB.Connection") or die("Cannot start ADO" . odbc_errormsg());
#$conn2->Open($provider);
$conn2->Open("Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=****;Data Source=\\....\\Refurb Production2002_D.mdb;");
Here is one of the php files that contain a new connection. All other files have the exact same pattern.
#15
Re: Locating a database that I didn't create
Posted 23 July 2012 - 08:29 AM
|
|

New Topic/Question
Reply



MultiQuote







|