Using phpadmin.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Using phpadmin.

Post by Bill H »

I am using a mysql database with php. Right now I am managing the database (adding tables, colums, etc) by sending queries with the mysql_query function, like:

Code: Select all

<?php
$Query = "ALTER TABLE Staff DROP COLUMN sref";
$Result = mysql_query($Query, $Link);
?>
This is certainly unwieldy, and it sometimes takes five or six tries before I qet the query string correct and make it happen.

So I looked at phpadmin.

There are something like 12 files that I'm (maybe) supposed to download, or maybe I'm supposed to pick one "set" of (I think) three of those files.

I think I'm supposed to download three files, but I'm not sure at all which three and I have no clue where to put them. Apparently at least one file starts out in my web document root and then I "tar" it or "gz" it or something like that.

There's one zip file, and I know what that is but it doesn't seem to be very useful by itself, and I can't tell where to unzip it to.

Can anyone give me a simplified idiot's version of what that system does and how to install it? Or am I better off continuing to do it through code?
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

I use phpmyadmin all the time. However I am unable to tell you how to install it as I use Debian. All I had to do with debian was type apt-get install phpmyadmin and away it went.

As far as using it I would suggest it. It is much easier. Once you are in there it pretty much makes sense especially from the way you were doing it before.
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

Thanks for your reply. I don't doubt it is easier than the way I'm doing it.

But it doesn't help much if I can't even get through the first step toward installing it.

I checked their site. The documentation assumes a great more knowledge about servers than I possess. The user support forum has no posts in it more recent that Dec of last year.

I guess I'm stuck with what I've been doing unless someone here can:
a) suggest an alternative, or
b) give me some "idiot level" advice on installing it.

Maybe if I get more specific: (quotes are from phpmyadmin documentation)
Choose and download a distribution kit with the files having the extension (.php3 or .php) depending on the way your web/PHP server interprets those extensions.
What is a "distribution kit" and, having downloaded it, where do I put it?
Untar or unzip the distribution (be sure to unzip the subdirectories): tar xzvf phpMyAdmin_x.x.x.tar.gz in your webserver's document root.
What does the above mean?
If you don't have direct access to your document root, put the files in a directory on your local machine, and, after step 3, transfer the directory on your web server using, for example, ftp.
I've been using Windows for quite a few years and I have no idea how to "tar" a file on my local (Windows) machine.
Open the file config.inc.php3 in your favourite editor and change the values for host, user, password and authentication mode to fit your environment. Also insert the correct value for $cfg['PmaAbsoluteUri']. Have a look at Configuration section for an explanation of all values.
This part I could probably do, If I could ever get to this point.
Open the file <www.your-host.com>/<your-install-dir>/index.php3 in your browser. phpMyAdmin should now display a welcome screen and your databases, or a login dialog if using http or cookie authentication mode.
This is the first thing that I actually understood.
User avatar
BigE
Site Admin
Posts: 139
Joined: Fri Apr 19, 2002 9:49 am
Location: Missouri, USA
Contact:

Post by BigE »

First of all, what you need to do is download the .php extensions most likely. If your using windows, just extract the files into a directory you can call them from your webserver, assuming you have one setup. Next, edit config.inc.php to suit your needs, then call the phpMyAdmin/index.php from your web browser, and run it.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

To expand on BigE's reply ->

You only need the .zip file which contains the files with the .php extension:
http://www.phpmyadmin.net/index.php?dl=3
Each set of the zipped (or tarred) files is a distribution kit so you only need one. You then want to extract the files within the zip file to somewhere where the webserver can find it. If you are running IIS this is by default the inetpub/wwwroot directory and for Apache this is Apache's htdocs folder (IIRC).

Mac
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

You folks are a real treasure. Thanks for your help.

The only problem left is that if I set the $cfg['PmaAbsoluteUri'] var I get a "page not found" error when I select a table. If I leave it blank everything works okay but there is a warning on the index page saying that I must set it.

No big deal, I can live with the warning.

Also it won't create a new table, but I think I have to work that out with my hosting company. I get error 140, which I think is a permissions problem.

Everyone is right, this is an "easier softer way." Thanks again.
User avatar
BigE
Site Admin
Posts: 139
Joined: Fri Apr 19, 2002 9:49 am
Location: Missouri, USA
Contact:

Post by BigE »

to fix that problem, just set that variable to this

Code: Select all

&lt;?php
$cfg&#1111;'PmaAbsoluteUri'] = 'http://' . $_SERVER&#1111;'HTTP_HOST'] . '/phpMyAdmin/';
?&gt;
That should just be a simple soloution to your problem.
User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

Thanks, BigE, that did indeed solve the problem.

Thanks to all of you who are making my life easier.
Post Reply