Re: call the chado table

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: call the chado table

Stephen Ficklin-2
Hi Zhensheng,

There are instructions on this page for accessing the chado tables in postgres:  http://tripal.sourceforge.net/?q=node/18

Also, are you planning to develop PHP code that will be a part of your Drupal/Tripal website?  If so, I would recommend you follow the Drupal developers instructions:  http://drupal.org/documentation/develop (follow instructions for Drupal 6.x).  You can find even better instructions in this book:  http://www.amazon.com/o/ASIN/1430209895.  (if you buy the book, make sure you do not buy the edition for Drupal 7.  Tripal has not yet been ported to Drupal 7).  Drupal has an Application Programmer Interface (API) that helps you develop applications (or modules) in PHP that can interact directly with Drupal.  Drupal does have a bit of a learning curve for development, but once you learn it, it makes development so much faster.

Also, I will be writing a formal Developers Handbook for Tripal this month.  We have some collaborators who need it.  Tripal has an API as well that lets your applications interact with Tripal. I should have that Developers Handbook ready in the next week or two.

Finally, if you develop something you think might be useful for other Tripal users you can submit your modules to our extensions repository:  http://tripal.sourceforge.net/?q=extensions.

Thanks,
Stephen


On 10/10/2011 4:24 AM, 陈镇生 wrote:
Hi Stephen,
 
I have a problem about how to call the chado table from the database. I write the code by myself to call the chado table,and it show query failed. I can call the public table  of the postersql database,but I can't call the chado table. So can you teach me how to call the chado table of the database ?

My test code:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <html>
   <head>
<title>postgresql</title>  
   </head>
   <body>      

 <?php
 // attempt a connection
 $dbh = pg_connect("host=localhost dbname=<dbname> user=<dbuser>");
 if (!$dbh) {
     die("Error in connection: " . pg_last_error());
 }      

 // execute query
 $sql = "SELECT * FROM analysis";
 $result = pg_query($dbh, $sql);
 if (!$result) {
     die("Error in SQL query: " . pg_last_error());
 }      
while ($row = pg_fetch_array($result)) {
     echo "program : " . $row[0] . "<br />";
     echo "programversion : " . $row[1] . "<p />";
 }      

 // free memory
 pg_free_result($result);      

 // close connection
 pg_close($dbh);
 ?>      

   </body>
 </html>


Thanks,
Zhensheng


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Gmod-tripal mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gmod-tripal