I'm using UNIXODBC to communicate with a MSSQL Server. I've got this query that works in a direct SQL connection tool but in the PHP webpage it doesnt work. Do you provide support for this kind of problem. I'll past the code snippet below.
THE STRAIGHT SQL version via connection tool
select DISTINCT
Itm_Itemnr,Itm_ISBNNr,Itm_Outeur,Itm_AfrikaPrys,
Itm_DollarPrys,Itm_PondPrys,Itm_EuroPrys,
Itm_WebStatus,Itm_SellOnWeb ,
Bb_Itemnr,Bb_Translated,Bb_Language,Bb_Title,Bb_SubTitle,
CONVERT (VARCHAR(1500),Bb_KortBeskrywing) AS Short,
Img_Itemnr,Img_Image,
IKat_Itemnr, IKat_Kategorie,Itm_Prys
from Items
INNER JOIN BoekBeskrywing ON Itm_Itemnr = Bb_Itemnr
INNER JOIN Image ON Itm_Itemnr = Img_Itemnr
INNER JOIN ItemKategorie ON Itm_Itemnr = Kat_Itemnr
WHERE Itm_SellOnWeb =1 AND IKat_Kategorie ='Art';
=============================================
here's the web version
$sqlconnect=odbc_connect($dsn, $SQLUser,$SQLPass);
$odbcsql="select DISTINCT Itm_Itemnr,Itm_ISBNNr,Itm_Outeur,Itm_AfrikaPrys,
Itm_DollarPrys,Itm_PondPrys,Itm_EuroPrys,
Itm_WebStatus,Itm_SellOnWeb ,
Bb_Itemnr,Bb_Translated,Bb_Language,Bb_Title,Bb_SubTitle,
CONVERT (VARCHAR(1500),Bb_KortBeskrywing) AS Short,
Img_Itemnr,Img_Image,
IKat_Itemnr, IKat_Kategorie,Itm_Prys
from Items
INNER JOIN BoekBeskrywing ON Itm_Itemnr = Bb_Itemnr
INNER JOIN Image ON Itm_Itemnr = Img_Itemnr
INNER JOIN ItemKategorie ON Itm_Itemnr = IKat_Itemnr
WHERE Itm_SellOnWeb =1 AND IKat_Kategorie ='Art';";
$process=odbc_exec($sqlconnect,$odbcsql);
===============
And thats the thing. Just no rows returned. In fact I tried to run with IKat_Kategorie LIKE 'Music' or IKat_Kategorie = 'Music' and still no rows
I've setup the right drivers and DSN, it will return rows as long as I dont try and match against any text.
For example I could go "where webitem =1 AND price >$40"
that works fine
I'd appreciate any assistance, or even referral to other parties to get assistance.
Thanks in advance