Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > CocoaMySQL: How to modify table?

CocoaMySQL: How to modify table?
Thread Tools
Mac Enthusiast
Join Date: Oct 2001
Location: Chicago, IL
Status: Offline
Reply With Quote
Apr 17, 2004, 12:33 PM
 
Hey there,
I've been using CocoaMySQL to modify text in a database... and that's worked out great for me - awesome application. Anyway, I've got to modify the database with the following table (which was sent to me in a file called "featured_products.sql)":

-----

create table featured (
featured_id int(11) not null auto_increment,
products_id int(11) default '0' not null ,
featured_date_added datetime ,
featured_last_modified datetime ,
expires_date datetime ,
date_status_change datetime ,
status int(1) default '1' ,
PRIMARY KEY (featured_id)
);

INSERT INTO configuration_group (configuration_group_id, configuration_group_title, configuration_group_description, sort_order, visible) values ('39','Featured', 'Featured Products Display', '339', '1'
);

INSERT into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) values ('Display Featured Products', 'FEATURED_PRODUCTS_DISPLAY', 'true', 'Set to true or false in order to display featured.', '39', '1', now(), now()
);

INSERT into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added) values ('Maximum Display of Featured', 'MAX_DISPLAY_FEATURED_PRODUCTS', '6', 'This is the maximum amount of items to display on the front page.', '39', '2', now(), now()
);

-----

Does anyone who uses CocoaMySQL know where I'm supposed to copy and paste this so that it makes it happen (once I'm in the correct database)?

Thanks a ton,
BD
     
Mac Elite
Join Date: Jan 2001
Location: Saint-Jean-sur-Richelieu, Québec, Canada
Status: Offline
Reply With Quote
Apr 17, 2004, 03:37 PM
 
Select one command, copy, paste in 'Custom Query', click 'Run Query' enjoy!
     
Mac Enthusiast
Join Date: Oct 2001
Location: Chicago, IL
Status: Offline
Reply With Quote
Apr 17, 2004, 03:45 PM
 
Great,
So I'm assuming that I do this 4 times; once for each command, in the order which I displayed the commands above:

1) create table featured... (RUN QUERY)
2) INSERT INTO configuration_group... (RUN QUERY)
3) INSERT into configuration... (RUN QUERY)
4) INSERT into configuration... (RUN QUERY)

And for sure they don't all need to be run at the same time with one copy/paste that includes all 4? Thanks again,
BD
     
Mac Elite
Join Date: Jan 2001
Location: Saint-Jean-sur-Richelieu, Québec, Canada
Status: Offline
Reply With Quote
Apr 17, 2004, 03:46 PM
 
Originally posted by BoulderDash:
Great,
So I'm assuming that I do this 4 times; once for each command, in the order which I displayed the commands above:

1) create table featured... (RUN QUERY)
2) INSERT INTO configuration_group... (RUN QUERY)
3) INSERT into configuration... (RUN QUERY)
4) INSERT into configuration... (RUN QUERY)

And for sure they don't all need to be run at the same time with one copy/paste that includes all 4? Thanks again,
BD
You'll have a 'Invalid query' if you put them in line. Do one at a time and it will be fine
     
Mac Enthusiast
Join Date: Oct 2001
Location: Chicago, IL
Status: Offline
Reply With Quote
Apr 17, 2004, 04:39 PM
 
Awesome,
Thanks a ton... I'm going to give it a go later tonight.

See ya,
BD
     
Mac Elite
Join Date: Jan 2001
Location: Saint-Jean-sur-Richelieu, Québec, Canada
Status: Offline
Reply With Quote
Apr 17, 2004, 04:48 PM
 
Originally posted by BoulderDash:
Awesome,
Thanks a ton... I'm going to give it a go later tonight.

See ya,
BD
np!
     
Mac Enthusiast
Join Date: Oct 2001
Location: Chicago, IL
Status: Offline
Reply With Quote
Apr 18, 2004, 02:23 PM
 
Hey there,
Just thought I'd also post this from the developer:

-----

Hi,
The attached file is just a text file containing MySQL commands. You could copy and paste them in the Custom Query view, but it's easier to import the file using the menu-item "Import > CocoaMySQL dump...". It imports not just CocoaMySQL dumps, but every type of sql-file (files containing MySQL commands).

Best Regards,
Lorenz

-----

Now there's a couple of ways to tackle this. See ya,
BD
     
   
Thread Tools
Forum Links
Forum 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
Top
Privacy Policy
All times are GMT -5. The time now is 10:16 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2