Announcement

Collapse
No announcement yet.

ajax alert message! returns a field value in ID

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

  • #16
    And changing

    $query = "SELECT GROUP_CONCAT(roomname SEPARATOR ', ') FROM rooms WHERE roomno IN (". implode(',',[rooms_updated]).")"; // SEPARATOR = comma + blank (it looks nicer)
    for

    $query = "SELECT GROUP_CONCAT(roomdesc SEPARATOR ', ') FROM rooms WHERE roomno IN (". implode(',',[rooms_updated]).")"; // SEPARATOR = comma + blank (it looks nicer)
    Don't do the job?
    /Giuseppe

    Professional Scriptcase Services
    Some Customers opinions

    Comment


    • #17
      no it didn't, thats why maybe should be selected or PK was the issue. Now is ok as i returned it back as it was

      Comment


      • #18
        Originally posted by itsme3 View Post
        no it didn't, thats why maybe should be selected or PK was the issue. Now is ok as i returned it back as it was
        No. Query Autopsia:
        Code:
        SELECT GROUP_CONCAT(roomdesc SEPARATOR ', ')
        Return a row with all roomdesc field and concatenate using ", " as separator

        Code:
        FROM rooms
        ...from rooms table

        Code:
        WHERE roomno IN (". implode(',',[rooms_updated]).")";
        ....where field roomnumber value is on array you filled previously.

        Primary Key is to define to a table how a record should be unique. It has nothing to do with using fields on a query (well, PK means too to have an INDEX over this field, but this just means more faster query over this field).

        Maybe my brain is not wake up yet, but as far as I see, tha change I suggest should work.
        /Giuseppe

        Professional Scriptcase Services
        Some Customers opinions

        Comment


        • #19
          You right, we both didn't wake up yet, world cup syndromes loool, you aright, it seemed to be working, all was fine, maybe i missed some detail that time, anyway as i changed the table and things are fine, i moved on to new challenge now

          Comment


          • #20
            hi Giu,

            this is still working fine as implode array from roomn0 when are integers, but what if i have the roomno as text "varchar" I get nothing out of the array!?

            perhaps is like integer and should be a string!? how i can do this to work while field roomno

            WHERE roomno IN (". implode(',',[rooms_updated]).")";

            Comment

            Working...
            X