Caucho Forums  

This forum is permanently closed because of spam. For free community support, please visit Google Groups:


Go Back   Caucho Forums > Quercus

Reply
 
Thread Tools Display Modes
  #1  
Old 04-19-2013, 12:33 PM
gordon gordon is offline
Junior Member
 
Join Date: Jul 2012
Posts: 12
Default 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
Reply With Quote
  #2  
Old 04-19-2013, 01:46 PM
nam nam is offline
Administrator
 
Join Date: Aug 2009
Posts: 337
Default

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()?
Reply With Quote
Reply

Tags
error, jdbc, query, sql, sqlite

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:12 PM.


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