Previous help on this list got me almost going (I think).  But here's
where I am.

----------------------------
My PDO Attempts:

I am getting a PDO object returned but attempts at using it to make
queries seem to fail without any error.  That is, the $rs object
print_r's nothing.. not even null.  So I don't understand this.

Here's the SQL that built the tables (I inserted a couple rows by hand
using isql):

http://pastebin.com/4et88WNy <http://pastebin.com/4et88WNy> 

Here's the contents of /etc/odbc.ini:
[virtuoso]
Driver = /usr/local/virtuoso-opensource/lib/virtodbc_r.so
address = localhost:1111

And here's the PHP code that results in no errors but a single line of
"Hey dude!" output:
http://pastebin.com/xv0ajkPs <http://pastebin.com/xv0ajkPs> 

I've tried using 'odbc:virtuoso;dbname=studies' but that gives the
following error (after I changed the logError() to a print statement):
Failed to connect to database: SQLSTATE[IM002] SQLDriverConnect: 0
[unixODBC][Driver Manager]Data source name not found, and no default
driver specified

-----------------------------------
My Non-PDO Attempts:

Here's my PHP code:


<?php

$dbc = odbc_connect('virtuoso','dba','dba');
if(!$dbc) { exit("Failed!"); }

odbc_exec($dbc,"USE studies;");

$sql = "SELECT * FROM studies;";
$rs=odbc_exec($dbc,$sql);


And here's the errors:

Warning: odbc_exec(): SQL error: [unixODBC][OpenLink][Virtuoso iODBC
Driver][Virtuoso Server]SQ074: Line 1: syntax error, SQL state 37000
in SQLExecDirect in /var/www/studies/test.php on line 6

Warning: odbc_exec(): SQL error: [unixODBC][OpenLink][Virtuoso iODBC
Driver][Virtuoso Server]SQ074: Line 1: No table studies in * reference
at ';' before ';', SQL state S0002 in SQLExecDirect in
/var/www/studies/test.php on line 9



I spent many hours Googling and trying things.. I am stuck.

 

Matthew C. Tedder

Software Engineer
Clinical and Translational Research Informatics Program (CTRIP)
University of Florida
1329 SW 16th St. RM 5026
Gainesville, FL 32608
352.265.0111 Ext. 86107 (desk)

509-432-5520 (cell)
UF Campus Mail: Box 100147/ICHP
USPS Mail: PO Box 100177, Gainesville, FL 32610

 

Reply via email to