Forums Register Login

MySQL error

+Pie Number of slices to send: Send
Hi all,

The query is "SELECT * FROM tblPages t WHERE t.SiteID=1000 AND t.DisplayModule = 'on' and t.Deleted = 'N' order by t.navorder"

When i execute the above query using JDBC i get the following Exception:

java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'BY t.navorder' at line 1"


but when i execute the same query at the command prompt it works without any problem.

I am using MySQL 4.1 database

Please help,
Seshu
+Pie Number of slices to send: Send
use PreparedStatement to do that. like

String qry = "SELECT * FROM tblPages WHERE SiteID=? AND DisplayModule = ? and Deleted = ? order by navorder"

+Pie Number of slices to send: Send
I tried that,
the same error comes up

what could be the problem?

seshu
Are you okay? You look a little big. Maybe this tiny ad will help:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1115 times.
Similar Threads
what wrong with 1=1 ?
apostrophe ( ' ) issue in SQL of Hibernate.
Selecting the last record in the table using Hibernate
someone please help me out with this thing
Syntax error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:03:30.