Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
schema.php question
littlericky



Joined: 08 Feb 2007
Posts: 601

Posted: 08/18/09 21:02 
My first attempt at a module is for embedding widgets. Fields I need are, widget_id which is dynamically assigned),band_id(dynamically populated), widget_name(text), embed_code(textarea),widget_location(select), and widget_active(select)

Does the following look correct, specifically the widget_id? Thanks


Code

// jrWidgets
$tbl = "CREATE TABLE {$jamroom_db['jrWidgets']} (
  jrWidgets_widget_id INT(7) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY),
  jrWidgets_band_id INT(7) UNSIGNED NOT NULL,
  jrWidgets_widget_name VARCHAR(40) NOT NULL DEFAULT '', 
  jrWidgets_embed_code text NOT NULL DEFAULT '',
  jrWidgets_location INT(4) UNSIGNED NOT NULL DEFAULT '0',   
  jrWidget_active TINYINT(1) UNSIGNED NOT NULL DEFAULT '1',   
)";


Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 08/18/09 23:24 
I would normally do it like this:

Code
$tbl = "CREATE TABLE {$jamroom_db['jrWidgets']} (
  jrWidgets_widget_id INT(7) NOT NULL auto_increment,
  jrWidgets_band_id INT(7) NOT NULL,
  jrWidgets_widget_name VARCHAR(40) NOT NULL DEFAULT '',
  jrWidgets_embed_code text NOT NULL DEFAULT '',
  jrWidgets_location INT(4) NOT NULL DEFAULT '0',   
  jrWidget_active TINYINT(1) NOT NULL DEFAULT '1',
PRIMARY KEY  (jrWidgets_widget_id)   
)";


Try it and see if it triggers any errors.


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
littlericky



Joined: 08 Feb 2007
Posts: 601

Posted: 08/19/09 08:46 
Great thanks. I'll give it a try.

Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.