PCTechTalkhttp://www.pctechtalk.com/forums/

Go Back   PCTechTalk > PC Tech > Web Related

Reply
 
LinkBack Thread Tools Display Modes
Old 05-31-2005, 04:36 PM   #1 (permalink)
Moo indeed.
 
killer_cow's Avatar
 
Join Date: Dec 2002
Location: In a grassy field :D
Posts: 140
killer_cow
MySQL - Create Copy of a Table

Hey there PC tech talkers,

MySQL query:

I would like 2 tables with the same fields and field types etc. and have created one already with the required field names and properties, but was lazy and did it through the MySQL admin software and am looking for an easy way to simply 'copy' and 'paste' these fields into another table. Anyone know how I could do this?

Your knowledge would be a lot of my time saved.

Thanx in advance,

KC

(O, btw When I say 'fields' I would prefer to NOT be copying table data (ie. data entries in the table) across as well, I just want the field names and field properties etc.)
__________________
killer_cow is offline   Reply With Quote
Old 06-01-2005, 06:43 AM   #2 (permalink)
News Writer!
 
Pasty901's Avatar
 
Join Date: Nov 2002
Location: United Kingdom
Posts: 785
Pasty901 is on a distinguished road
not sure if this will be of interested but for all my mysql databases i use a little util called phpMyAdmin. Much nicer interface than the MySQL console and easier to navigate

www.phpmyadmin.net

__________________


"The hardest thing in this world is to live in it."
Pasty901 is offline   Reply With Quote
Old 06-01-2005, 09:15 AM   #3 (permalink)
Da House Nerd
 
greffov's Avatar
 
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
greffov will become famous soon enough
if you have the table already

insert into copy_table select * from orig_table;

if you don't have the table yet:

select * from orig_table into copy_table;


ohw and... console rawwwwwwwwwwwwks (but MySQL simply sucks)
__________________
Linux virusscanner detected a virus:
Windows 95 ... delete [Y/n] y
~
~

:wq
greffov is offline   Reply With Quote
Old 06-01-2005, 02:53 PM   #4 (permalink)
Moo indeed.
 
killer_cow's Avatar
 
Join Date: Dec 2002
Location: In a grassy field :D
Posts: 140
killer_cow
Hey gref,

Quote:
MySQL simply sucks
Whats a better alternative to MySQL for PHP? I wouldnt mind recommendations, I just use MySQL because it was the first one that was advertised to me when i started learning php. So I just started using it Any more powerful recommendations? What type of database does this forum use btw?

The project Im currently undertaking requires a database that will handle 'complicated' requests, that will need to be processed quickly, such as string and numerical searchs through over 1000 sets of data in seconds and also popping them out in chronological order etc. MySQL has alrady shown me some strengths and weaknesses, I currently mostly use PHP to filter out and order search results by retrieving all valid/unexpired entries and then use PHP if statements to stop entries that dont meet filter criteria from there on in till the printed result... any recommendations?

Cheers for your help so far, and yeh consol is good if you dont feel lazy like i do most days.

KC
__________________
killer_cow is offline   Reply With Quote
Old 07-27-2005, 10:02 AM   #5 (permalink)
Moo indeed.
 
killer_cow's Avatar
 
Join Date: Dec 2002
Location: In a grassy field :D
Posts: 140
killer_cow
Ammendment to greffov's 'select * from orig_table into copy_table;' for new tables....

That didn't work properly....

But found the solution

Here it is:

CREATE TABLE new_table_name SELECT * FROM original_table;
__________________
killer_cow is offline   Reply With Quote
Old 07-27-2005, 01:18 PM   #6 (permalink)
Da House Nerd
 
greffov's Avatar
 
Join Date: Dec 1969
Location: One CPU Lane
Posts: 3,512
greffov will become famous soon enough
ohw, sorry, on the one database that works, on the other the other... it all does the same, but the syntax is quite different...
__________________
Linux virusscanner detected a virus:
Windows 95 ... delete [Y/n] y
~
~

:wq
greffov is offline   Reply With Quote
Old 10-16-2008, 05:37 AM   #7 (permalink)
Registered User
 
Join Date: Oct 2008
Posts: 14
beilwei123 is on a distinguished road
Arrow welcome to massage in shanghai

I fully support you, this is my task. I hope you better:Shanghai massage|Shanghai escort|massage Shanghai|massage in Shanghai
beilwei123 is offline   Reply With Quote
Old 11-30-2008, 11:04 AM   #8 (permalink)
Registered User
 
Join Date: Nov 2008
Posts: 77
mofen375 is on a distinguished road
Red face I agree with you!!!

I like your article!!!The article very interesting.------------------------------------------------------------------------------------------------------------------------------Welcome to our wow power leveling site:Cheapest Maple Story Mesos,Cheap WARHAMMER ONLINE GOLD for sale,RuneScape Money,buy SilkRoad Online Gold,buy Gaia Gold.LWB
mofen375 is offline   Reply With Quote
Old 12-22-2008, 02:50 AM   #9 (permalink)
Registered User
 
Join Date: Dec 2008
Posts: 10
lyjbgj20 is on a distinguished road
Red face 你想多有玩三年的时间吗

经北京市财政局批准,工商注册登记成立的信息公司。公司成立起点高,专业性强,现有员工中具会计师及以上职 称的8人,教授级顾问3人,专业咨询人员18人。专门从事财务代理、税务代理、财税咨询和工商代理等业务的 专业机构。 业务范围  本公司本着为贵单位合理合法 , 节省经营成本和开支的 , 在诚信保密的基础上 , 专业的理财。发票|北京?l票|北京开发票|建筑发票|广告发票|13521714999|北京?l票代开|代开广告发票|代开北京?l票|代开建筑发票|工程发票:建筑发票、北京?l票,广告发票、广告发票、建筑工程发票、咨询发票、酒店发票,会议发票、房屋租赁发票、租赁发票、建筑发票、 建筑公司,北京建筑公司,北京建筑工程公司,广告公司,北京广告公司,咨询公司,北京咨询公司、餐饮发票、 技术发票、国税发票、地税发票、商业发票,普通发票,工业企业发票;装修发票,广告发票;北京?l票服务中心。
lyjbgj20 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -5. The time now is 09:10 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
2001 PCTechTalk