Results 1 to 5 of 5

Thread: Simple Question re syntax

  1. #1
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default Simple Question re syntax

    Can someone please tell me what this command means exactly? The part I don't understand is ",NULL as EventID". Thanks.

    Code:
    $query = "SELECT categories.*, NULL as EventID FROM categories WHERE IsActive = 1 AND PkID > 0 ORDER BY CategoryName";

  2. #2
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    Null will be EventID ?!

    but didn't understand why null ><

  3. #3
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    I don't understand why NULL either, which is why I am asking. I didn't write the code. I just have to make it work and some of it does weird stuff and I'm trying to understand if there is an error. I hate supporting other people's code. Is it even a correct statement? What does "NULL as EventID" mean?

  4. #4
    Join Date
    Jul 2008
    Posts
    21
    Thanks
    4
    Thanked 2 Times in 2 Posts

    Default

    it is a mysql querry calling the categories table or database and i think it is attempting to print the categories but hide the database id for that category this may help with why i am not sure with out seeing more code.

    problem with null

  5. The Following User Says Thank You to pngsigut For This Useful Post:

    kuau (07-11-2008)

  6. #5
    Join Date
    Sep 2007
    Location
    Maui
    Posts
    642
    Thanks
    284
    Thanked 15 Times in 15 Posts

    Default

    Is it possibly a shorthand way of saying:

    $EventID = "NULL";
    SELECT * FROM categories AS EventID WHERE...

    PS. We ended up dropping this software package because the guy who sold it to us (and who wrote it) was a total jerk, and it didn't work properly & he was unwilling to address the problems. Life is too short. Geesh... open source is definitely the way to go. But I am trying to learn MySQL and could not find this usage in the MySQL documentation. Maybe that's why it didn't work haha.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •