SQL not finding records based on a specific field.

Post Reply
Dsquared
Posts: 7
Joined: Thu Oct 04, 2001 1:40 pm

SQL not finding records based on a specific field.

Post by Dsquared »

I have written a million SQL statements, but for some reason I am completely stumped on this.

We have a table w/ book descriptions, isbn numbers, titles and subtitles. When we run this SQL statement it works fine:

<sql skip=$skip max=$x "select * from books where Title LIKE $query">

When we try to substitue Title for say ISBN no values are returned. Yet when the results come back from the title search there is a value for ISBN. So obviously the ISBN field is populated but when queried no results are found.

I have tried these two sql statements:

<sql skip=$skip max=$x "select * from books where isbn = 0688173055">
<sql skip=$skip max=$x "select * from books where isbn LIKE $query OR SubTitle LIKE $query">

Still no results are returned.
Any Ideas?

Are the field names case sensitive?
bart
Posts: 251
Joined: Wed Apr 26, 2000 12:42 am

SQL not finding records based on a specific field.

Post by bart »

Did you view the HTML source after submission and the error logs? There's probably an error message there. Maybe something about operating on an un-indexed field.
Dsquared
Posts: 7
Joined: Thu Oct 04, 2001 1:40 pm

SQL not finding records based on a specific field.

Post by Dsquared »

How do I view the SQL errors?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

SQL not finding records based on a specific field.

Post by mark »

"... view the HTML source ..." of the results page. The errors would be in HTML comments. Also morph3/texis/vortex.log.

And, yes, table and field names are case sensitive.
Post Reply