Page 1 of 12

[Tutorial] How to use phpMyAdmin

Posted: Fri Nov 02, 2007 6:44 am
by battye
How to use phpMyAdmin

Many MOD's require users to run a file to apply SQL changes, however, there are some that require you to make manual database changes.

In 2.0.x MOD's, you know you are required to apply SQL changes manually when there is no update file supplied, and you find the following action in the MOD install file:

Code: Select all

#
#-----[ SQL ]------------------------------------------
#
In a MODx file, you will find a similar action.

In the SQL section, you may find many different queries. This tutorial explains how to manually apply these using phpMyAdmin.

For the sake of this tutorial, suppose the SQL query you were required to run was as follows (note: there may be more than one, they will all be listed).

Code: Select all

INSERT INTO phpbb_config (config_name, config_value) values('allow_userbar_upload', '1');
Opening phpMyAdmin

More often than not, a link to phpMyAdmin will be provided, under the databases section, in your webhosts cPanel, Ensim or another sort of control panel. If you are unable to find a link to phpMyAdmin from your control panel, you may need to talk to your webhost and ask if it is preinstalled. If it is not, you will need to install it yourself. Download phpMyAdmin, and find documentation on installation, from http://www.phpmyadmin.net/

What to do once in phpMyAdmin

After opening the program, on the left panel, navigate to your database by clicking the dropdown menu, and clicking the database which your forum resides in.

The right panel will then display a list of tables. Ignoring these, proceed to clicking the "SQL" tab on the top navigation bar.

Image

Paste the query/queries that you need into the large box titled "Run SQL query/queries on database". Ensure the table prefix is correct. In the majority of cases, it will simply be phpbb_, but in this case, it was myforum_. Check the box "Show this query here again" and once satisfied, proceed to click "Go".

Image

You know the queries were executed successfully if no errors appear. You should get a screen similar to this:

Image

If you get any errors, read the error message carefully and rectify the problem. If you are unsure of an error message, and you are not able to find an answer after searching the forum and searching Google, feel free to post it within this topic for further assistance.

Thanks,

The phpBB MOD Team

How to use phpMyAdmin

Posted: Fri Nov 02, 2007 12:11 pm
by mara7
thats good ..
it is useful ..
I love it ..

regard ,

Re: [Tutorial] How to use phpMyAdmin

Posted: Fri Nov 02, 2007 12:28 pm
by battye
mara7 wrote:thats good ..
it is useful ..
I love it ..

regard ,
Thanks :)

Re: [Tutorial] How to use phpMyAdmin

Posted: Mon Nov 05, 2007 12:35 pm
by yaw_pakhtoon
thanks alot for this.. i sometimes get confussed..

Re: [Tutorial] How to use phpMyAdmin

Posted: Tue Nov 06, 2007 10:40 pm
by SpongeFreak52
Nice job! Simple, yet very helpful I'm sure.

Re: [Tutorial] How to use phpMyAdmin

Posted: Thu Nov 08, 2007 8:49 pm
by enix
Thank you, direct and usefull tutorial.
[]'s

Re: [Tutorial] How to use phpMyAdmin

Posted: Fri Nov 09, 2007 4:28 pm
by jwxie
this is a great tutorial
it's good to expand the subject into more detail caterogies

Re: [Tutorial] How to use phpMyAdmin

Posted: Fri Nov 09, 2007 6:33 pm
by bonelifer
This is good. So why haven't you submitted it to the KB? Marshalrusty isn't that mean. :lol:

Re: [Tutorial] How to use phpMyAdmin

Posted: Sat Nov 10, 2007 3:20 am
by battye
Thanks for the kind words everyone, I am glad everyone is finding it useful :)

Re: [Tutorial] How to use phpMyAdmin

Posted: Wed Dec 26, 2007 9:48 pm
by jmjm003
Thanks for the info.
Being new to php and mysql every little bit helps. (former .asp & access user)

I do have a question if you don't mind.
How would you remove your example from the database if you wanted to.
I can insert, just do not know how to remove. (sounds kinda personal there. :shock:)

Any help would be appreciated.

JM

Re: [Tutorial] How to use phpMyAdmin

Posted: Thu Dec 27, 2007 5:23 am
by battye
:shock: :lol:

If you want to delete a record, you can use code like:

Code: Select all

DELETE FROM tablename WHERE column = 'value';
Or you can find the record, and click the delete button next to it - if I remember correctly it is a little red cross.

A word of warning - be very careful when deleting records, it is irreversible and not something you should do unless you are 100% confident.

Re: [Tutorial] How to use phpMyAdmin

Posted: Fri Dec 28, 2007 11:36 am
by m1k30rz
Great tutorial! Whats the best version of phpMyAdmin to use though?

Re: [Tutorial] How to use phpMyAdmin

Posted: Fri Dec 28, 2007 1:31 pm
by Tripp
Just stayed updated but I think it depends on your host.

Re: [Tutorial] How to use phpMyAdmin

Posted: Thu Jan 10, 2008 5:52 am
by ThunderCrew
Good tutorial and perhaps you could help with what I posted on the support forum.
I am trying to make one of my pages to work on 3.0 wich does work on 2.x, but not sure
how to get it right now.

I need to do a "user is logged in check" then IF they are logged in pull some info out of the databse
from the admin created custom profile filed for that user.

Any ideas/

Re: [Tutorial] How to use phpMyAdmin

Posted: Mon Jan 14, 2008 6:36 pm
by gbr1918
Hi Thundercrew,
The easiest way (I think) is something like
<?php
if(ISSET your_cookie){
do the database connection;
do the database query;
do whatever else with the data;
.......;
}
?>
(Sorry, the post doesn't show the indents!)
Hope that helps.
Dave