Forums

This topic is locked

DW MX substring SQL Problem???

Posted 23 Sep 2003 17:02:44
1
has voted
23 Sep 2003 17:02:44 Ronnie van de Laak posted:
Hello,
I seem to be having getting Dreamweaver to properly accept the following code:

select
days_lin_id,
substring(days_txt_name,1,3),
if(coda_dte_open is null and coda_dte_closed is null and coda_dte_open2 is null and coda_dte_closed2 is null, 'CLOSED', substring(coda_dte_open,1,5)),
substring(coda_dte_closed,1,5),
substring(coda_dte_open2,1,5),
substring(coda_dte_closed2,1,5),
if(coda_dte_open is null and coda_dte_closed is null and coda_dte_open2 is null and coda_dte_closed2 is null, 1, 0)
from tluDays
left outer join tlkCompany_Days
on (days_lin_id = coda_days_lin_id and coda_comp_lin_id = @WebsiteSearchID)
order by days_lin_id;

When I enter it the first time it looks OK, but when I start dragging the result fields into the design window, DW breaks the fields in the server behaviors at the commas of the "if" and "substring" sections.

It also changes the code in the design view to look like a php icon instead of showing something like {openHours.days_txt_name}, for example.

When I run the sql as a test in DW it works and I get my result.

I am using PHP/ADODB (also tried the PHP/MYSQL model and the same happened) with DW MX.

All the other SQL queries work fine, this is the only one with a substring query and it fails.

Any help would be greatly appreciated!

Reply to this topic