mihaiparjolea
Posts: 2
|
Posted: 06/07/2012, 1:03 AM |
|
hy
i have this code:
SELECT , invoices.*, DATEDIFF(\".CCToSQL(date('Y-m-d', strtotime(CCFormatDate(CCParseDate(CCGetParam(dateraport', ''),array('dd',' ','mm',' ','yyyy')), array('yyyy','-','mm','-','dd')))), ccsDate).\",data_two) AS days1,\n\n" .
when i use with \" result day1 empty
when i remove the \ from code days1 are correct .....
how can i use the correct code ( with \" ) and the result days1 = correct ?
thanks
|
|
|
Lucius
Posts: 220
|
Posted: 06/07/2012, 6:04 AM |
|
Hi
Correct code is not the one with \", but one with only qoutes.
The backslash is an escape character, so in the example you quoted, everything you wrote is passed to SQL verbatim, including the PHP code.
You should use the backslash when you need the quotes in SQL, for example:
SELECT * FROM table WHERE x = ' \" ' ;
|
|
|
mihaiparjolea
Posts: 2
|
Posted: 06/07/2012, 10:50 PM |
|
ok, and how do this ? becouse this code is generate by codechargestudio
me i write :
DATEDIF(". - and my select works fine if i remove manualy the \ after ccs generate
and codecharge transform in
DATEDIF(\". - and my select don't works fine , and is frustating to change any time the final code
|
|
|
Lucius
Posts: 220
|
Posted: 06/12/2012, 4:04 AM |
|
The above SQL is generated by CCS ?
Can you please write what you do (which functionality you use) that will generate SQL code like:
SELECT , invoices.*, DATEDIFF(\".CCToSQL(date('Y-m-d', strtotime(CCFormatDate(CCParseDate(CCGetParam....
|
|
|
|