Page 1 of 1

SQL not finding records based on a specific field.

Posted: Wed Nov 07, 2001 4:26 pm
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?

SQL not finding records based on a specific field.

Posted: Wed Nov 07, 2001 4:45 pm
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.

SQL not finding records based on a specific field.

Posted: Wed Nov 07, 2001 10:27 pm
by Dsquared
How do I view the SQL errors?

SQL not finding records based on a specific field.

Posted: Wed Nov 07, 2001 11:02 pm
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.