Syntax error at "h" And SQLPrepare() failed

User avatar
John
Site Admin
Posts: 2597
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

Syntax error at "h" And SQLPrepare() failed

Post by John »

How is the RAM table created, and then selected from? Do you know how many rows it should have?
John Turnbull
Thunderstone Software
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

Syntax error at "h" And SQLPrepare() failed

Post by mark »

I don't know what you mean by path. I was suggesting changing your existing
"select count(*) ic from $tablename
to
"select count(*) ic from " $tablename "

Your value for
Prod in ( h:▒▒ )
needs to be quoted since you're generating your own SQL
Prod in ( 'h:▒▒' )
If that's not the expected value, print out your $comsqlquery $sqlGrpsQuery variables to see what's in them.

Rather than use literals I'd suggest using variables, if possible, for values to avoid escapement/injection issues:
<$pq1='h:&#9618;&#9618;'>
Prod in ( $pq1 )
princegoyal91
Posts: 12
Joined: Mon Jul 21, 2014 5:46 am

Syntax error at "h" And SQLPrepare() failed

Post by princegoyal91 »

Mark/John,

I replaced the code for that particular file(search) with the working one. Now there is no error in the logs.

But still my public scripts(front-end) are not able to fetch the records from texis DB.

Do you have any idea for this?

Thanks
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

Syntax error at "h" And SQLPrepare() failed

Post by mark »

Not sure what you mean by "not able to fetch records". Perhaps you've fixed the syntax errors but not logic errors. e.g. is "h:&#9618;&#9618;" really what you're trying to lookup or is that an artifact of an earlier mistake building the query from the RAM table?

Try setting tracesql to 4 to see exactly what you're executing and all data values.
princegoyal91
Posts: 12
Joined: Mon Jul 21, 2014 5:46 am

Syntax error at "h" And SQLPrepare() failed

Post by princegoyal91 »

The current situation is, I took the code from other instance where it is working fine.

The values for "Prod in ( h:&#9618;&#9618; )" is coming perfectly. And logs does not show any error.

Now, the issue is, from the front-end of our application, when we try to search something, we are not getting the results and the records are indexed properly aswell in the texis database.

Here I need your advise on what could be the possible reason.
User avatar
mark
Site Admin
Posts: 5513
Joined: Tue Apr 25, 2000 6:56 pm

Syntax error at "h" And SQLPrepare() failed

Post by mark »

Impossible to say without knowing all about your setup.
You'll have to debug each step along the way to see what's passed and expected back to see where it breaks down.
Post Reply