Current location: Hot Scripts Forums » Other Discussions » Database » MYSQL database


MYSQL database

Reply
  #1 (permalink)  
Old 06-15-07, 03:54 AM
countll countll is offline
New Member
 
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
MYSQL database

i got 2 script which i wannto combine it to 1..i mean put it into 1 folder to my public_html...
theres 2 database.sql to be upload to mysql database...
can i just copy nad paste make it to 1?
is it will overide in the mysql?


here is the database...

sql Code:
  1. # phpMyAdmin MySQL-Dump
  2. #
  3. # Table structure for table `admin`
  4. #
  5.  
  6. DROP TABLE IF EXISTS admin;
  7. CREATE TABLE admin (
  8.   user varchar(100) NOT NULL DEFAULT '',
  9.   pass varchar(100) NOT NULL DEFAULT ''
  10. ) TYPE=MyISAM;
  11.  
  12. INSERT INTO admin VALUES ( 'adnet', '*******');
  13.  
  14. # --------------------------------------------------------
  15.  
  16. #
  17. # Table structure for table `affiliates`
  18. #
  19.  
  20. DROP TABLE IF EXISTS affiliates;
  21. CREATE TABLE affiliates (
  22.   refid varchar(30) NOT NULL DEFAULT '',
  23.   pass varchar(20) NOT NULL DEFAULT '',
  24.   company varchar(100) NOT NULL DEFAULT '',
  25.   title varchar(5) NOT NULL DEFAULT '',
  26.   firstname varchar(40) NOT NULL DEFAULT '',
  27.   lastname varchar(40) NOT NULL DEFAULT '',
  28.   website varchar(100) NOT NULL DEFAULT '',
  29.   email varchar(100) NOT NULL DEFAULT '',
  30.   payableto varchar(100) NOT NULL DEFAULT '',
  31.   street varchar(100) NOT NULL DEFAULT '',
  32.   town varchar(100) NOT NULL DEFAULT '',
  33.   county varchar(100) NOT NULL DEFAULT '',
  34.   postcode varchar(20) NOT NULL DEFAULT '',
  35.   country varchar(100) NOT NULL DEFAULT '',
  36.   phone varchar(30) NOT NULL DEFAULT '',
  37.   fax varchar(30) NOT NULL DEFAULT '',
  38.   date varchar(40) NOT NULL DEFAULT ''
  39. ) TYPE=MyISAM;
  40. # --------------------------------------------------------
  41.  
  42. #
  43. # Table structure for table `banners`
  44. #
  45.  
  46. DROP TABLE IF EXISTS banners;
  47. CREATE TABLE banners (
  48.   number int(3) NOT NULL AUTO_INCREMENT,
  49.   name varchar(50) NOT NULL DEFAULT '',
  50.   image varchar(60) NOT NULL DEFAULT '',
  51.   description varchar(200) NOT NULL DEFAULT '',
  52.   PRIMARY KEY  (number)
  53. ) TYPE=MyISAM;
  54. # --------------------------------------------------------
  55.  
  56. #
  57. # Table structure for table `clickthroughs`
  58. #
  59.  
  60. DROP TABLE IF EXISTS clickthroughs;
  61. CREATE TABLE clickthroughs (
  62.   refid varchar(20) DEFAULT 'none',
  63.   date date NOT NULL DEFAULT '0000-00-00',
  64.   time time NOT NULL DEFAULT '00:00:00',
  65.   browser varchar(200) DEFAULT 'Could Not Find This Data',
  66.   ipaddress varchar(50) DEFAULT 'Could Not Find This Data',
  67.   refferalurl varchar(200) DEFAULT 'none detected (maybe a direct link)',
  68.   buy varchar(10) DEFAULT 'NO'
  69. ) TYPE=MyISAM;
  70. # --------------------------------------------------------
  71.  
  72. #
  73. # Table structure for table `sales`
  74. #
  75.  
  76. DROP TABLE IF EXISTS sales;
  77. CREATE TABLE sales (
  78.   refid varchar(20) NOT NULL DEFAULT '',
  79.   date date NOT NULL DEFAULT '0000-00-00',
  80.   time time NOT NULL DEFAULT '00:00:00',
  81.   browser varchar(100) NOT NULL DEFAULT '',
  82.   ipaddress varchar(20) NOT NULL DEFAULT '',
  83.   payment varchar(10) NOT NULL DEFAULT ''
  84. ) TYPE=MyISAM;

AND THIS>>>>

sql Code:
  1. CREATE TABLE `admin` (
  2.   `AdminID` int(10) NOT NULL AUTO_INCREMENT,
  3.   `username` varchar(50) NOT NULL DEFAULT '',
  4.   `PASSWORD` varchar(32) NOT NULL DEFAULT '',
  5.   `email` varchar(255) NOT NULL DEFAULT '',
  6.   PRIMARY KEY  (`AdminID`),
  7.   UNIQUE KEY `username` (`username`)
  8. ) TYPE=MyISAM AUTO_INCREMENT=2 ;
  9.  
  10. # --------------------------------------------------------
  11.  
  12. #
  13. # Table structure for table `banners`
  14. #
  15.  
  16. CREATE TABLE `banners` (
  17.   `BannerID` int(10) NOT NULL AUTO_INCREMENT,
  18.   `BannerFile` text NOT NULL,
  19.   `BannerAlt` varchar(255) NOT NULL DEFAULT '',
  20.   `BannerURL` text NOT NULL,
  21.   PRIMARY KEY  (`BannerID`)
  22. ) TYPE=MyISAM AUTO_INCREMENT=1 ;
  23.  
  24. # --------------------------------------------------------
  25.  
  26. #
  27. # Table structure for table `cart`
  28. #
  29.  
  30. CREATE TABLE `cart` (
  31.   `OrderID` varchar(32) NOT NULL DEFAULT '',
  32.   `ItemID` int(10) NOT NULL DEFAULT '0',
  33.   `ItemPrice` float(10,2) NOT NULL DEFAULT '0.00',
  34.   `ItemQty` int(10) NOT NULL DEFAULT '0',
  35.   `ItemTotal` float(10,2) NOT NULL DEFAULT '0.00',
  36.   `download_status` char(1) NOT NULL DEFAULT 'n'
  37. ) TYPE=MyISAM;
  38.  
  39. # --------------------------------------------------------
  40.  
  41. #
  42. # Table structure for table `categories`
  43. #
  44.  
  45. CREATE TABLE `categories` (
  46.   `CategoryID` int(10) NOT NULL AUTO_INCREMENT,
  47.   `CategoryName` varchar(255) NOT NULL DEFAULT '',
  48.   PRIMARY KEY  (`CategoryID`),
  49.   UNIQUE KEY `CategoryName` (`CategoryName`)
  50. ) TYPE=MyISAM AUTO_INCREMENT=11 ;
  51.  
  52. # --------------------------------------------------------
  53.  
  54. #
  55. # Table structure for table `items`
  56. #
  57.  
  58. CREATE TABLE `items` (
  59.   `ItemID` int(10) NOT NULL AUTO_INCREMENT,
  60.   `ItemName` varchar(255) NOT NULL DEFAULT '',
  61.   `ItemDesc` text NOT NULL,
  62.   `ItemPrice` float(10,2) NOT NULL DEFAULT '0.00',
  63.   `ItemImage` text NOT NULL,
  64.   `DownloadURL` text NOT NULL,
  65.   `ItemCategory` int(10) NOT NULL DEFAULT '0',
  66.   `ItemSubcategory` int(10) NOT NULL DEFAULT '0',
  67.   PRIMARY KEY  (`ItemID`),
  68.   UNIQUE KEY `ItemName` (`ItemName`)
  69. ) TYPE=MyISAM AUTO_INCREMENT=88 ;
  70.  
  71. # --------------------------------------------------------
  72.  
  73. #
  74. # Table structure for table `links`
  75. #
  76.  
  77. CREATE TABLE `links` (
  78.   `LinkID` int(10) NOT NULL AUTO_INCREMENT,
  79.   `LinkName` varchar(255) NOT NULL DEFAULT '',
  80.   `LinkURL` varchar(255) NOT NULL DEFAULT '',
  81.   PRIMARY KEY  (`LinkID`)
  82. ) TYPE=MyISAM AUTO_INCREMENT=1 ;
  83.  
  84. # --------------------------------------------------------
  85.  
  86. #
  87. # Table structure for table `newsletter`
  88. #
  89.  
  90. CREATE TABLE `newsletter` (
  91.   `nemail` varchar(150) NOT NULL DEFAULT '',
  92.   PRIMARY KEY  (`nemail`)
  93. ) TYPE=MyISAM;
  94.  
  95. # --------------------------------------------------------
  96.  
  97. #
  98. # Table structure for table `orders_info`
  99. #
  100.  
  101. CREATE TABLE `orders_info` (
  102.   `OrderID` int(10) NOT NULL AUTO_INCREMENT,
  103.   `FirstName` varchar(100) NOT NULL DEFAULT '',
  104.   `LastName` varchar(100) NOT NULL DEFAULT '',
  105.   `email` varchar(255) NOT NULL DEFAULT '',
  106.   `order_paid` char(1) NOT NULL DEFAULT 'n',
  107.   `order_date` int(10) NOT NULL DEFAULT '0',
  108.   `order_total` float(10,2) NOT NULL DEFAULT '0.00',
  109.   `ExpDate` int(10) NOT NULL DEFAULT '0',
  110.   PRIMARY KEY  (`OrderID`)
  111. ) TYPE=MyISAM AUTO_INCREMENT=6 ;
  112.  
  113. # --------------------------------------------------------
  114.  
  115. #
  116. # Table structure for table `settings`
  117. #
  118.  
  119. CREATE TABLE `settings` (
  120.   `id` int(1) NOT NULL DEFAULT '0',
  121.   `SiteName` text NOT NULL,
  122.   `SiteTitle` text NOT NULL,
  123.   `SiteKeywords` text NOT NULL,
  124.   `SiteDesc` text NOT NULL,
  125.   `help` text NOT NULL,
  126.   `PayPalEmail` varchar(255) NOT NULL DEFAULT '',
  127.   `ContactEmail` varchar(255) NOT NULL DEFAULT '',
  128.   `currency_id` varchar(50) NOT NULL DEFAULT 'USD',
  129.   `currency_sign` varchar(20) NOT NULL DEFAULT '$',
  130.   `download_days` int(3) NOT NULL DEFAULT '14',
  131.   `sp_payee_email` varchar(255) NOT NULL DEFAULT '',
  132.   `sp_vendor_email` varchar(255) NOT NULL DEFAULT '',
  133.   `sp_secret_code` varchar(255) NOT NULL DEFAULT ''
  134. ) TYPE=MyISAM;
  135.  
  136. # --------------------------------------------------------
  137.  
  138. #
  139. # Table structure for table `subcategories`
  140. #
  141.  
  142. CREATE TABLE `subcategories` (
  143.   `SubcategoryID` int(10) NOT NULL AUTO_INCREMENT,
  144.   `SubcategoryName` varchar(255) NOT NULL DEFAULT '',
  145.   `CategoryID` int(10) NOT NULL DEFAULT '0',
  146.   PRIMARY KEY  (`SubcategoryID`)
  147. ) TYPE=MyISAM AUTO_INCREMENT=1 ;

please help me dive in it.thanks....

Last edited by Christian; 06-15-07 at 04:18 AM. Reason: Please use [highlight=sql] tags when posting SQL code. It's also probably not a good idea to post your password. ;)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-17-07, 04:43 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
since there are 2 tables with the same name (admin, banner) then you can't put them in one database unless you rename them in one of the script and then trace all the occurences in the script that uses them and rename them there as well.
Then you also have to make sure that the script files themselves don't have names conflicts.
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-19-07, 05:20 PM
Sxooter Sxooter is offline
Newbie Coder
 
Join Date: Jun 2007
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Since MySQL kinda treats databases like postgresql and oracle do schemas (i.e. you can do cross db joins and such in mysql) is there a real big reason to want to put them into the same db?

If not, you can leave them in separate dbs and they should be fine.

otherwise you're gonna have to do something to tell the table(s) with the same name apart, i.e. rename them and edit all the code that accesses them, which can be error prone.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Form to update a MySQL database? Scoobler PHP 9 09-04-08 02:41 AM
Flat file vs mysql database Imusion PHP 5 06-13-06 01:10 PM
Basic MySQL Database 5.00usd Offer KeYBLeR Job Offers & Assistance 0 04-10-06 04:40 PM
MicroOLAP Database Designer for MySQL 1.8 Released microolap General Advertisements 1 09-20-05 11:00 AM
Clear my misunderstanding: 1 MySQL database for many programs? iKwak PHP 3 08-21-05 01:50 PM


All times are GMT -5. The time now is 01:26 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.