This is a discussion on echoing mysql result within the PHP Language forums, part of the PHP Programming Forums category; Hey everyone. I have a simple form with three fields, when the user submits, I want the php to echo ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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="document.myform.mytype.value"; $typeinals="document.myform.myals.value"; $typeinfdoi="document.myform.myfdoi.value"; $myQuantity = mysql_query("SELECT * 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? |
|
|||
|
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 -- |
|
|||
|
On May 12, 12:06 pm, "Álvaro G. Vicario"
<alvaroNOSPAMTHA...@demogracia.com> wrote: > 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! |
|
|||
|
Brian Spotts wrote:
> On May 12, 12:06 pm, "Álvaro G. Vicario" > <alvaroNOSPAMTHA...@demogracia.com> wrote: >> 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 ;-) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|