Caucho Forums

Caucho Forums (http://forum.caucho.com//index.php)
-   Quercus (http://forum.caucho.com//forumdisplay.php?f=5)
-   -   SQLite/JDBC query not returning text? (http://forum.caucho.com//showthread.php?t=29517)

gordon 04-19-2013 11:33 AM

SQLite/JDBC query not returning text?
 
Hi Nam,

I am back again with a very odd problem.

My SQL queries are not returning text. This sounds odd but that is what it looks like.

My SQLite table schema

CREATE TABLE [Elements] (
[ID] INTEGER NOT NULL PRIMARY KEY UNIQUE,
[Name] TEXT,
[Type] TEXT,
[ServiceLevelAnswerThreshold] INTEGER,
[ShortAnsweredCallThreshold] INTEGER,
[ShortAbandonedCallThreshold] INTEGER,
[MaximumWaitTime] INTEGER,
[MaximumRingTime] INTEGER,
[MaximumWrapUpTime] INTEGER);


My SQL query and php code


$sql = "SELECT Name, ID, Type FROM Elements";
echo
"<tr>
<td> Name</td>
<td> Id</td>
<td> Type</td>
</tr>\n";

foreach ($db->query($sql) as $row) {

echo "<tr><td>" . $row['Name'] . "</td><td>" . $row['ID'] . "</td><td>" . $row['Type'] . "</td></tr>\n";
};


My results should be

Name Id Type
Skill 43 2 Skill
Skill 42 3 Skill
Skill 41 4 Skill
Gordon Drew 11 Agent
Nick Gibbs 12 Agent
Erich Hermann 13 Agent
Bernd Jobes 14 Agent


But what I actually get is

Name Id Type
2
3
4
11
12
13
14


I'm getting the integers, but not the text. I've verified the code on a different machine, it works and returns both text and integers. Obviously this could be something to do with the jdbc driver I'm using, sqlite-jdbc-3.7.2.jar, but maybe you have come across this before. Am I doing something stupid?

regards

Gord








Name ID Type

nam 04-19-2013 12:46 PM

Hi gordon,

Are you saying that Quercus works on one machine, but not on another?

Can you paste the code for the function $db->query()?


All times are GMT. The time now is 04:49 PM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.