{"id":26124,"date":"2010-01-12T19:32:42","date_gmt":"2010-01-12T23:32:42","guid":{"rendered":"http:\/\/www.bu.edu\/tech\/?page_id=26124"},"modified":"2013-04-11T13:55:09","modified_gmt":"2013-04-11T17:55:09","slug":"database","status":"publish","type":"page","link":"https:\/\/www.bu.edu\/tech\/services\/cccs\/websites\/www\/non-wordpress\/marconi\/how-to\/database\/","title":{"rendered":"How to Output to a Database"},"content":{"rendered":"<p>On this page:<\/p>\n<ul>\n<li><a href=\"#sql\">Output to a MySQL Database<\/a><\/li>\n<li><a href=\"#filemaker\">Output to a FileMaker Pro Database<\/a><\/li>\n<\/ul>\n<p><a name=\"sql\"><\/a><\/p>\n<h3>Output to a MySQL Database<\/h3>\n<ol>\n<li>Add this line of code to your Telegraph configuration file:<br \/>\n<code>&lt;directive action=\"database\" host=\"<strong>mysql-server-hostname<\/strong>\" username=\"<strong>your-mysql-username<\/strong>\" password=\"<strong>your-mysql-password<\/strong>\" database=\"<strong>your-database-name<\/strong>\" table=\"<strong>your-table-name<\/strong>\" \/&gt;<\/code><\/li>\n<li>Replace <strong>mysql-server-hostname<\/strong> with the name of your MySQL server and port information, <strong>your-mysql-username<\/strong> with your MySQL username,\u00a0 <strong>your-mysql-password<\/strong> with your MySQL password,\u00a0 <strong>your-database-name<\/strong> with the name of your database and <strong>your-table-name<\/strong> with the name of the table that you are inserting data into.<\/li>\n<\/ol>\n<ul>\n<li>Example:<br \/>\n<code>&lt;directive action=\"database\" server=\"www-mysql:3309\" username=\"barney\" password=\"rubble\" database=\"dbin_cragglerock\" table=\"rock_types\" \/&gt;<\/code><\/li>\n<\/ul>\n<p>Telegraph will automatically create a new row in your table, matching fields from your form to identically-named fields in your database table. Any fields in your form which do not correspond to your database table&#8217;s field names will be ignored during the database insert. (Nothing stops these fields from being used in another Telegraph directive.<\/p>\n<p>You can use multiple <code>&lt;directive action=\"database\" \/&gt;<\/code> tags to insert data into multiple MySQL database tables.<br \/>\n<a name=\"filemaker\"><\/a><\/p>\n<h3>Output to a FileMaker Pro Database<\/h3>\n<p>You cannot update a FileMaker Pro Database directly using Telegraph. However, Telegraph can be used to create a spreadsheet that can be manually or automatically used to populate your FileMaker Pro Database.<\/p>\n<ol>\n<li>Set up your form to <a href=\"https:\/\/www.bu.edu\/tech\/services\/cccs\/websites\/www\/non-wordpress\/telegraph\/how-to\/spreadsheet\/\"> output to a spreadsheet<\/a>. Most versions of FileMaker Pro support importing both CSV and tab-delimited spreadsheets.<\/li>\n<li>Make sure that all form fields being sent to your database are appearing in your spreadsheet.<\/li>\n<li>Manually download or script a download of your spreadsheet for use with FileMaker Pro.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>On this page: Output to a MySQL Database Output to a FileMaker Pro Database Output to a MySQL Database Add this line of code to your Telegraph configuration file: &lt;directive action=&#8221;database&#8221; host=&#8221;mysql-server-hostname&#8221; username=&#8221;your-mysql-username&#8221; password=&#8221;your-mysql-password&#8221; database=&#8221;your-database-name&#8221; table=&#8221;your-table-name&#8221; \/&gt; Replace mysql-server-hostname with the name of your MySQL server and port information, your-mysql-username with your MySQL username,\u00a0 your-mysql-password&#8230;<\/p>\n","protected":false},"author":1282,"featured_media":0,"parent":26082,"menu_order":3,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/26124"}],"collection":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/users\/1282"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/comments?post=26124"}],"version-history":[{"count":15,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/26124\/revisions"}],"predecessor-version":[{"id":64861,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/26124\/revisions\/64861"}],"up":[{"embeddable":true,"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/pages\/26082"}],"wp:attachment":[{"href":"https:\/\/www.bu.edu\/tech\/wp-json\/wp\/v2\/media?parent=26124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}