Using the $ character in query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cover

    Using the $ character in query

    Does anyone know a successful way to use the dollar sign character
    within a query and not generate an error?

    Here's what I'm trying to do... I have a query that successfully
    counts the number of records within a query as well as totalizes the
    dollar amount. What I'd like to do is show a dollar sign ahead of the
    'amount' total when it queries back to the screen in my html document.

    Is there something I can use to null the normal relationship PHP has
    with the $ character where again, I can use it for text purposes?

    TIA
  • Homechoice

    #2
    Re: Using the $ character in query

    Why not simply assign a variable to the result and then add the dollar
    sign?

    Something like (pseudo PHP)

    $shownamount = "$".$myquery.to talname



    In article <ht75p19vmbq58l moqk1jiuutnf32h kbrom@4ax.com>,
    coverlandNOSPAM 914@yahoo.com says...[color=blue]
    > Does anyone know a successful way to use the dollar sign character
    > within a query and not generate an error?
    >
    > Here's what I'm trying to do... I have a query that successfully
    > counts the number of records within a query as well as totalizes the
    > dollar amount. What I'd like to do is show a dollar sign ahead of the
    > 'amount' total when it queries back to the screen in my html document.
    >
    > Is there something I can use to null the normal relationship PHP has
    > with the $ character where again, I can use it for text purposes?
    >
    > TIA
    >[/color]

    Comment

    • Kimmo Laine

      #3
      Re: Using the $ character in query

      "cover" <coverlandNOSPA M914@yahoo.com> kirjoitti
      viestissä:ht75p 19vmbq58lmoqk1j iuutnf32hkbrom@ 4ax.com...[color=blue]
      > Does anyone know a successful way to use the dollar sign character
      > within a query and not generate an error?
      >
      > Here's what I'm trying to do... I have a query that successfully
      > counts the number of records within a query as well as totalizes the
      > dollar amount. What I'd like to do is show a dollar sign ahead of the
      > 'amount' total when it queries back to the screen in my html document.
      >
      > Is there something I can use to null the normal relationship PHP has
      > with the $ character where again, I can use it for text purposes?[/color]


      <?php

      $query = "here's a cool dollar sign: ".'$'." , and some more text";
      $anotherquery = "Another way to put a dollar sign \$ is to escape it with a
      backslash";
      echo $query;
      echo $anotherquery;

      ?>

      --
      SETI @ Home - Donate your cpu's idle time to science.
      Further reading at <http://setiweb.ssl.ber keley.edu/>
      Kimmo Laine <antaatulla.sik anautaa@gmail.c om.NOSPAM.inval id>


      Comment

      • Sandman

        #4
        Re: Using the $ character in query

        In article <dmufad$7tb$1@p hys-news4.kolumbus. fi>,
        "Kimmo Laine" <antaatulla.sik anautaa@gmail.c om.NOSPAM.inval id> wrote:
        [color=blue]
        > "cover" <coverlandNOSPA M914@yahoo.com> kirjoitti
        > viestissä:ht75p 19vmbq58lmoqk1j iuutnf32hkbrom@ 4ax.com...[color=green]
        > > Does anyone know a successful way to use the dollar sign character
        > > within a query and not generate an error?
        > >
        > > Here's what I'm trying to do... I have a query that successfully
        > > counts the number of records within a query as well as totalizes the
        > > dollar amount. What I'd like to do is show a dollar sign ahead of the
        > > 'amount' total when it queries back to the screen in my html document.
        > >
        > > Is there something I can use to null the normal relationship PHP has
        > > with the $ character where again, I can use it for text purposes?[/color]
        >
        >
        > <?php
        >
        > $query = "here's a cool dollar sign: ".'$'." , and some more text";
        > $anotherquery = "Another way to put a dollar sign \$ is to escape it with a
        > backslash";
        > echo $query;
        > echo $anotherquery;
        >
        > ?>[/color]

        print '$A $third $way $is $to $not $use $interpolating $quotes';



        --
        Sandman[.net]

        Edwin, on protecting against malware:
        "I use Avast AV, the Yahoo anti-spy toolbar, the MS anti-spy software,
        Windows SP2 with its firewall, AdAware, Spybot Search and Destroy, and
        SpywareBlaster. "

        Comment

        • cover

          #5
          Re: Using the $ character in query

          Thanks very much for the replies and great ideas, all... Thanks to
          your help, the problems's resolved and it looks slick... :-)

          Comment

          • JDS

            #6
            Re: Using the $ character in query

            On Sun, 04 Dec 2005 00:00:42 -0800, cover wrote:
            [color=blue]
            > Does anyone know a successful way to use the dollar sign character
            > within a query and not generate an error?[/color]

            Use single quotes

            But what is the actual code that is generating an error and what is the
            error?

            --
            JDS | jeffrey@example .invalid
            | http://www.newtnotes.com
            DJMBS | http://newtnotes.com/doctor-jeff-master-brainsurgeon/

            Comment

            Working...