echoing mysql result

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

    #1

    echoing mysql result

    Hey everyone. I have a simple form with three fields, when the user
    submits, I want the php to echo under the form the results in my sql
    table that match the three fields in the form. I'm tried to use
    variables similar to:

    $typeinform="do cument.myform.m ytype.value";
    $typeinals="doc ument.myform.my als.value";
    $typeinfdoi="do cument.myform.m yfdoi.value";

    $myQuantity = mysql_query("SE LECT * FROM totals WHERE type =
    '$typeinform'
    AND als = '$typeinals'
    AND fdoi = '$typeinfdoi'

    I'm basically trying to figure out how to get the php to echo that
    result in my page after the user submits. I've tried this...


    <<<FORM>>>>
    <?php
    echo $myQuantity;
    ?>

    It doesn't return anything though, any ideas?
  • =?ISO-8859-1?Q?=22=C1lvaro_G=2E_Vicario=22?=

    #2
    Re: echoing mysql result

    Brian Spotts escribió:
    Hey everyone. I have a simple form with three fields, when the user
    submits, I want the php to echo under the form the results in my sql
    table that match the three fields in the form. I'm tried to use
    variables similar to:
    [...]
    <<<FORM>>>>
    <?php
    echo $myQuantity;
    ?>
    >
    It doesn't return anything though, any ideas?
    The tutorial in the PHP manual can give a general idea of how form
    handling works:



    Hint: $_GET and $_POST

    Also, document.myform .mytype.value is client-side JavaScript. PHP is a
    server-side language.


    --
    -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
    -- Mi sitio sobre programación web: http://bits.demogracia.com
    -- Mi web de humor al baño María: http://www.demogracia.com
    --

    Comment

    • Brian Spotts

      #3
      Re: echoing mysql result

      On May 12, 12:06 pm, "Álvaro G. Vicario"
      <alvaroNOSPAMTH A...@demogracia .comwrote:
      Brian Spotts escribió:
      >
      Hey everyone. I have a simple form with three fields, when the user
      submits, I want the php to echo under the form the results in my sql
      table that match the three fields in the form. I'm tried to use
      variables similar to:
      [...]
      <<<FORM>>>>
      <?php
      echo $myQuantity;
      ?>
      >
      It doesn't return anything though, any ideas?
      >
      The tutorial in the PHP manual can give a general idea of how form
      handling works:
      >

      >
      Hint: $_GET and $_POST
      >
      Also, document.myform .mytype.value is client-side JavaScript. PHP is a
      server-side language.
      >
      --
      --http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
      -- Mi sitio sobre programación web:http://bits.demogracia.com
      -- Mi web de humor al baño María:http://www.demogracia.com
      --
      ok thanks very much! I knew I got turned around somewhere! Learning
      Javascript, php, and mysql all withing about 2 months of each other
      probably wasn't the best idea!

      Comment

      • The Natural Philosopher

        #4
        Re: echoing mysql result

        Brian Spotts wrote:
        On May 12, 12:06 pm, "Álvaro G. Vicario"
        <alvaroNOSPAMTH A...@demogracia .comwrote:
        >Brian Spotts escribió:
        >>
        >>Hey everyone. I have a simple form with three fields, when the user
        >>submits, I want the php to echo under the form the results in my sql
        >>table that match the three fields in the form. I'm tried to use
        >>variables similar to:
        >[...]
        >><<<FORM>>>>
        >><?php
        >>echo $myQuantity;
        >>?>
        >>It doesn't return anything though, any ideas?
        >The tutorial in the PHP manual can give a general idea of how form
        >handling works:
        >>
        >http://es2.php.net/manual/en/tutorial.forms.php
        >>
        >Hint: $_GET and $_POST
        >>
        >Also, document.myform .mytype.value is client-side JavaScript. PHP is a
        >server-side language.
        >>
        >--
        >--http://alvaro.es- Álvaro G. Vicario - Burgos, Spain
        >-- Mi sitio sobre programación web:http://bits.demogracia.com
        >-- Mi web de humor al baño María:http://www.demogracia.com
        >--
        >
        ok thanks very much! I knew I got turned around somewhere! Learning
        Javascript, php, and mysql all withing about 2 months of each other
        probably wasn't the best idea!
        Welcome to the grey hair club ;-)

        Comment

        Working...