No Support => General discussion (no support!) => Topic started by: legend_neo on January 18, 2005, 09:00:11 pm

Title: Running DB commands .. someone please help me
Post by: legend_neo on January 18, 2005, 09:00:11 pm
hi .. let me clear first ... im just a student and dont know much about coding ...(but i m tryingmy best to understand) ..
so... please... dont get board of my stupid questions ...

ok.. the thing is i need help on running Data base commands... i m cuoting two coads ... and i dont know how to implement it ... so .. i was wondering if someone please explain them a little ... with step by step ....
thast will be a great help :)
coad from "A phpbb style 'who is online' block "
Code: [Select]
CREATE TABLE cpg_online (
  user_id int(11) NOT NULL default '0',
  user_ip tinytext NOT NULL,
  last_action datetime default NULL,
  PRIMARY KEY  (user_id,user_ip(15))

and secondly  ...from "User Login with email instead of username "
Code: [Select]
INSERT INTO `cpg131_config` ( `name` , `value` )
'login_with', 'username'

i m just quoting these 2 examples for refrences. ... i just need to know ... how to creat these tables with data base . i m having php 4.3.10 and also i can use phpmyadmin ..
just a little guidnce of yours ...........
thankxxx in advance
Title: Re: Running DB commands .. someone please help me
Post by: jmc on January 18, 2005, 09:38:50 pm
Hi, legend!
To run these sql commands on your database you need to log in to phpMyAdmin and select your coppermine database from the drop-down list on the left side of the screen. When the entire database structure is displayed, you will see all the db tables with their appropriate table "prefixes" (e.g. cpg132_ for latest version of CPG). This is an important point to observe... because the codes you have quoted will not actually work with later versions. You will first need to open both of your mysql files using notepad and manually edit the cpg_ and cpg131_ prefixes to match your existing database prefixes where necessary.
When you have done that, the steps in phpMyAdmin differ due to the nature of the sql command you wish to run.
Example 1 is creating a new table in the database. Copy the new command to the clipboard and click the SQL tab at the top of the Admin screen. In the large text area which you now see, paste the sql command, then click the "Go" button. phpMyAdmin will generate a short report commenting on the success or failure of the process. If successfull.. you're finished!
Example 2 is different. You are not creating a new table, you are INSERTING data into an existing table. So, copy the new command to clipboard, then click the selection box beside the table cpg131_config. Now, click the sql tab at the top. Paste the sql command into the text area and click Go. Finished!
Good luck!
John Mc
Title: Re: Running DB commands .. someone please help me
Post by: legend_neo on January 23, 2005, 08:32:54 pm
Thankxxx  a lot ..
it really helped me ..