Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHPMyAdmin & SQL


Guest

Recommended Posts

I was looking through the BTS files and the instructions say I need to use phpmyadmin to call the sql file.....how the heck do I do that? I suck at using phpadmin and have no idea on how do this. Could someone help me a little here? Thank you very much :)

 

- NeoNiko

Link to comment
Share on other sites

It depends on what folder you installed your phpmyadmin utility (presuming you have).

 

Say it's just at the root, and you called the folder PHPMyAdmin. Type in your webbrowser http://www.yourdomain.com/PHPMyAdmin

 

At that point it would bring you to a login screen with a PHPMyAdmin logo, telling you you have to have cookies enabled, and it would give you a login spot. Your username and password for administrative access to your server is what you would enter there.

 

After successfully loggin in, you have to create the database and then you can use sql queries to create tables and their contents.

 

Hope this helps!

 

Crys

Link to comment
Share on other sites

It kinda helps. It's already pre-installed on the server from the ISP and I can access it. I just don't know what to do from there. I've tried looking on the phpmyadmin site for help, but it only confused me more :P And i haven't been able to find any other docs to show me how.

Link to comment
Share on other sites

You can create a new database (say members). If you create that database Then you need to set up at least one table on the database (creating it by name usually gives you the option of naming a table and naming the number of fields for that table). You might put 10 fields on that table - and then say Go. That will take you to a screen where you label each field name (ie membername, memberstreetln1, city, state, zip, etc). You also set the nature of each field. Names you would want VARCHAR and a smaller number of characters value (say 50). Dates would use the DATE designation and for money values you probably want to use DECIMAL (and for that value you'd want to put something like 7,2 for 7 numbers before the decimal, 2 after). You want to figure out what you want your default first or sorting field to be and establish it as the primary key - for instance, if you have a bunch of products you may have a unique productid and may want to establish it as the primary key. (PHPMyAdmin lets you choose the primary key with a radio button over to the right towards the last of the columns as you configure your table).

 

The PHPMyAdmin tool portal pretty much lets you use drop-down menus and text boxes instead of having you have to type in the code like:

 

CREATE TABLE `thetablenameyouchose` (

`fieldone` CHAR( 25 ) NOT NULL ,

`fieldtwo` VARCHAR( 115 ) NOT NULL ,

`fieldthree` DATE NOT NULL ,

`moneyfield` DECIMAL( 7, 2 ) NOT NULL ,

PRIMARY KEY ( `fieldone` )

);

 

However, you can do just that (if you've got a sql query template you can easily cut and paste with your own modifications) by creating the initial database name in PHPMyAdmin and then choosing that Database, then clicking on the SQL tab.

 

It may help you to figure out a bit about the types of fields and how they are stored. For instance, CHAR always stores the entire string - so CHAR(20) will always save 20 spaces even if "a" is all that is entered on an entry of that table. However, VARCHAR will only save how many spaces are used, so even if you put VARCHAR(255), if you put "a" in that field for a row, it will only store the one character. Whether or not spaces are maintained depends on your version of sql that you are using, so if you need to be sure your entries' spaces are maintained you might want to use BLOB or TEXT as the fieldtype. So when you're creating your table you want to be sure to understand what will be put into the fields and how you want the information to look when you're retrieving it, and which SQL fieldtypes will work best for your purposes.

 

Though you've probably read through it (and it's not like it really is a lot of help for those who like to read plain English) here's a link to the create table helpbox in the MySQL documentation - http://dev.mysql.com/doc/mysql/en/create-table.html.

 

Best wishes.

 

Crys

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...