echoing mysql result

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-12-2008
Brian Spotts
 
Posts: n/a
Default 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="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?
Reply With Quote
  #2 (permalink)  
Old 05-12-2008
Álvaro G. Vicario
 
Posts: n/a
Default 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:

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
--
Reply With Quote
  #3 (permalink)  
Old 05-12-2008
Brian Spotts
 
Posts: n/a
Default Re: echoing mysql result

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!
Reply With Quote
  #4 (permalink)  
Old 05-12-2008
The Natural Philosopher
 
Posts: n/a
Default Re: echoing mysql result

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 ;-)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:44 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0