Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

MySQL from the command line.


greree

Recommended Posts

Posted

In my database in the table "customers" in the field "customers_dob", the type is listed as "DATETIME" with the default "0000-00-00 00:00:00". I need to give instructions to someone on how to change this to type "CHAR" with no default and with a length of 1. What would be the best way, assuming I don't know which front end will be used for MySQL. I was thinking command line, except I don't know how to do it. Anyone know the syntax? Thanks.

Posted

I can tell you that, without a doubt, the easiest way to use a mySQL interface is by using phpMyAdmin. This is a free php-mySQL tool that you can download from http://www.phpmyadmin.net and simply install it on your server. This is so much more user friendly than a command prompt that you will figure it out in no time.

 

Hope this helps,

-Chris

Chris Sullivan

Posted

Thanks for the advice. I do use phpMyAdmin. But I can't assume everyone will. So I wanted to phrase the instructions in such a way so that anyone reading it could understand what I was doing and apply it to any MySQL frontend, or execute it from the command line.

Posted
Thanks for the advice. I do use phpMyAdmin. But I can't assume everyone will. So I wanted to phrase the instructions in such a way so that anyone reading it could understand what I was doing and apply it to any MySQL frontend, or execute it from the command line.

 

why not create a php file that does it for you? Execute the query with phpMyAdmin. Latest version has 'show this as php'. If it is for osCommerce (you didn't say but I assume it is) include application_top.php and you have access to all the tep_XXXX functions.

People will only have to run that script once and that's it.

You could even do a check to see if it was upgraded allready, if not execute, if so print message.

 

HTH

Mattice

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Posted

I may not have this exactly right but from telnet you could do this if they had it enabled

 

mysql> ALTER TABLE customers MODIFY customers_dob CHAR (20);

 

(20) being the number of charecters.

 

That should work

Archived

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

×
×
  • Create New...