Php / Mysql :0:,:1:

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nicolino101
    New Member
    • May 2008
    • 3

    Php / Mysql :0:,:1:

    Has anyone ever seen or used these type of variables when creating an sql_query?

    ex...

    Insert Into db.table ('id','name','a ddress') Values(:0:, :1:, :2:)

    Please let me know what the heck they are?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    No never seen it. I also never have seen a column name within single quotes. I am sure that will not work.

    Ronald

    Comment

    • nicolino101
      New Member
      • May 2008
      • 3

      #3
      Originally posted by ronverdonk
      No never seen it. I also never have seen a column name within single quotes. I am sure that will not work.

      Ronald

      Actually it's only the :0:, :1: (use of colons) that I'm concerned with...
      <br />
      Can't seem to find anything on it.

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        I have never seen this either, nor do I think this is valid syntax in either PHP or MySQL.

        Only possible reason I can see for doing something like this is if you plan on using regex to replace them with valid values.
        Perhaps a part of some custom template system?

        Comment

        • dlite922
          Recognized Expert Top Contributor
          • Dec 2007
          • 1586

          #5
          Originally posted by nicolino101
          Has anyone ever seen or used these type of variables when creating an sql_query?

          ex...

          Insert Into db.table ('id','name','a ddress') Values(:0:, :1:, :2:)

          Please let me know what the heck they are?
          Actually i have seen this, but it intrigued me then but never followed through.

          It has to do with variables like you said, mysql variables.

          Why not check out the manual and let us know. I'd like to find out and i'm sure these two knuckleheads would like to know that this is actually valid syntax. (or there is something like this).

          Comment

          • dlite922
            Recognized Expert Top Contributor
            • Dec 2007
            • 1586

            #6
            FOUND IT!!



            That's in 6.0, didn't look to see in prev ver but i'm sure this isn't something new.

            roverdonk, atli..... go hit the books! ;)

            But your right, what he had, was not valid syntax, but I think this is where I've seen colons used. In his example 1 and 2 are variable names.

            C YA!

            Comment

            • rpnew
              New Member
              • Aug 2007
              • 189

              #7
              Originally posted by nicolino101
              Has anyone ever seen or used these type of variables when creating an sql_query?

              ex...

              Insert Into db.table ('id','name','a ddress') Values(:0:, :1:, :2:)

              Please let me know what the heck they are?
              Hi,

              'id' can be `id` in MySql but never seen the values clause like that... post here if anyone gets answer..

              Regards,
              RP

              Comment

              • rpnew
                New Member
                • Aug 2007
                • 189

                #8
                Originally posted by dlite922
                FOUND IT!!



                That's in 6.0, didn't look to see in prev ver but i'm sure this isn't something new.

                roverdonk, atli..... go hit the books! ;)

                But your right, what he had, was not valid syntax, but I think this is where I've seen colons used. In his example 1 and 2 are variable names.

                C YA!
                Hi,

                Its there in earlier version as well but not what he has written... : on both side.. or something like that...

                Regards,
                RP

                Comment

                • nicolino101
                  New Member
                  • May 2008
                  • 3

                  #9
                  Thanks for the help... and I'm sorry about the confusion.
                  It should have been

                  Insert Into db.table id, name, address Values(:0:, :1:, :2:)

                  The colons are used for user defined variables in Mysql 6.
                  But, in my case I believe that they are being used differently.

                  Possibly as stated above in a regex statement on retrieval.

                  Not a MySql or PHP thing.

                  This is a great forum...
                  Last edited by nicolino101; May 9 '08, 03:17 PM. Reason: Made a small error

                  Comment

                  Working...