[Tutorial] How to use phpMyAdmin

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 11051
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia

[Tutorial] How to use phpMyAdmin

Post 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
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
User avatar
mara7
Registered User
Posts: 139
Joined: Wed May 11, 2005 5:59 pm

How to use phpMyAdmin

Post by mara7 »

thats good ..
it is useful ..
I love it ..

regard ,
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 11051
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia

Re: [Tutorial] How to use phpMyAdmin

Post by battye »

mara7 wrote:thats good ..
it is useful ..
I love it ..

regard ,
Thanks :)
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
yaw_pakhtoon
Registered User
Posts: 107
Joined: Wed Sep 12, 2007 12:18 am

Re: [Tutorial] How to use phpMyAdmin

Post by yaw_pakhtoon »

thanks alot for this.. i sometimes get confussed..
Image
SpongeFreak52
Registered User
Posts: 83
Joined: Tue May 23, 2006 12:54 am

Re: [Tutorial] How to use phpMyAdmin

Post by SpongeFreak52 »

Nice job! Simple, yet very helpful I'm sure.
enix
Registered User
Posts: 20
Joined: Thu Oct 04, 2007 4:19 pm

Re: [Tutorial] How to use phpMyAdmin

Post by enix »

Thank you, direct and usefull tutorial.
[]'s
User avatar
jwxie
Registered User
Posts: 392
Joined: Wed Feb 01, 2006 3:45 am

Re: [Tutorial] How to use phpMyAdmin

Post by jwxie »

this is a great tutorial
it's good to expand the subject into more detail caterogies
User avatar
bonelifer
Community Team Member
Community Team Member
Posts: 3626
Joined: Wed Oct 27, 2004 11:35 pm
Name: William

Re: [Tutorial] How to use phpMyAdmin

Post by bonelifer »

This is good. So why haven't you submitted it to the KB? Marshalrusty isn't that mean. :lol:
William Jacoby - Community Team
Knowledge Base | phpBB Board Rules | Search Customisation Database
Please don't contact me via PM or email for phpBB support .

phpBB Modders is looking for developers! If you have phpBB experience and want to join us, click here!
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 11051
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia

Re: [Tutorial] How to use phpMyAdmin

Post by battye »

Thanks for the kind words everyone, I am glad everyone is finding it useful :)
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
jmjm003
Registered User
Posts: 275
Joined: Sat Dec 22, 2007 7:05 pm

Re: [Tutorial] How to use phpMyAdmin

Post 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
User avatar
battye
Extension Customisations
Extension Customisations
Posts: 11051
Joined: Wed Feb 11, 2004 11:02 am
Location: Australia

Re: [Tutorial] How to use phpMyAdmin

Post 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.
Customisations Team Member

https://github.com/battye/php-array-parser - Give it a Star! :D
User avatar
m1k30rz
Registered User
Posts: 52
Joined: Sun Jun 05, 2005 6:14 am
Location: New Zealand

Re: [Tutorial] How to use phpMyAdmin

Post by m1k30rz »

Great tutorial! Whats the best version of phpMyAdmin to use though?
User avatar
Tripp
Former Team Member
Posts: 1358
Joined: Sun May 20, 2007 5:14 am
Location: G'boro, North Carolina
Name: Tripp

Re: [Tutorial] How to use phpMyAdmin

Post by Tripp »

Just stayed updated but I think it depends on your host.
The box said 'You need Windows XP or better' .... so I installed linux.

Formerly Drugs
User avatar
ThunderCrew
Registered User
Posts: 1438
Joined: Sat Jun 30, 2007 6:26 pm
Location: Ill, Usa

Re: [Tutorial] How to use phpMyAdmin

Post 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/
Ugg im a t0tal newb again ...... 2 years off cant remember jack ... time to get to it
gbr1918
Registered User
Posts: 31
Joined: Fri Jan 26, 2007 10:04 pm

Re: [Tutorial] How to use phpMyAdmin

Post 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

Return to “[3.0.x] MODs in Development”