Announcement

Collapse
No announcement yet.

Sql problem

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sql problem

    Hi,

    i've got an SQL problem with the use of a field from another dataset. I've confirmed the right field is choosen and running the SQL querie in phpMyAdmin does give me the right dataset.

    The sql statement is like :

    select * from `ing` where (CAST(\'" . ($my_data -> fields[2]) . "\' AS DATE) between `fromd` and `toda`)";


    the error = Undefined property: grid_ing_test_apl::$my_data_erro

    What could be wrong?

    Regards and thanks in advance

    Erwin

  • #2
    The best way it to look at the generated code to see what's wrong. The sql parser in scriptcase sometimes goes wrong, but it's hard to tell. Does the error shows a linenumber? Then the line of code can easily be found by going to the menu option 'view source'.
    Albert Drent
    aducom software netherlands
    scriptcase partner, reseller, support and (turn-key) development
    www.scriptcase.eu / www.scriptcase.nl

    Comment


    • #3
      No there is no mention of the line number , but is is clear it is that sql statement.

      2015-08-03_17-03-54.png

      This is the error. The first two lines are text just to show me that i'n in the right part of the code.

      Is there another way to do this?

      Comment


      • #4
        Perhaps it is the date thing, how do i convince myseft thah i'm passing a date to the querie?
        The CAST should do that.but ....

        Regards
        Erwin

        Comment


        • #5
          i found it, the leading \ was not nescesary although via phpmyadmin it shows this like php code

          Comment


          • #6
            With double quotes is not needed to escape ' char maybe for this reason didn't worked as expected.
            /Giuseppe

            Professional Scriptcase Services
            Some Customers opinions

            Comment

            Working...
            X