db variables not being passed 
Author Message
 db variables not being passed

I have a problem is a selection being generated by a pull down menu is
not being passed to the next page.

The <form> script makes a call to a mysql table to create the pull
down.  It is:

<?php
{
        $result=mysql_query("select name from customers") or die ("can't do
it");
        echo '<valign="top"> <select name="selected">',"\n";
        while ($myrow = mysql_fetch_row($result))
{
        echo '<option value="',$myrow[0],'">',$myrow[0],'</option>',"\n";

Quote:
}

        echo '</select>',"\n";
Quote:
}

?>

The submit script is outside the php with other html lines.  It is:

<input type="submit" name="submit" value="Existing Customer">

The next page is meant to match the chosen name ("selected") to a
field and then to write that field's corresponding customer-number to
a second table.  The code there is:

<?php
if($submit=="Existing Customer")
        // gets customer number to match selection from pull down menu
        $query=MYSQL_QUERY("SELECT cust_no FROM customers where
name=$selected");

        mysql_query($query) or die("can't get customer info
".mysql_error());

        $existing_no=$cust_no;

        // puts new customer number beside quote number in customerid_quoteid
table
        $query2=MYSQL_QUERY("update customerid_quoteid set
cust_no=$existing_no where quote_no=$quote_no");

        mysql_query($query2) or die("can't put new customer number beside
quote number   ".mysql_error());
?>  
The error message being returned is "Query was empty"

Any explanation is appreciated.

Thanks in advance

Alan Martensen



Sun, 04 Sep 2005 10:32:52 GMT  
 db variables not being passed
Hi Alan!

(...Problem with variable $xyz, which is based on a form...)

Check out register_globals, $_POST and about 100000 threads about this
topic.

HTH, Jochen



Sun, 04 Sep 2005 17:26:20 GMT  
 db variables not being passed

Quote:

> Hi Alan!

> (...Problem with variable $xyz, which is based on a form...)

> Check out register_globals, $_POST and about 100000 threads about this
> topic.

> HTH, Jochen

Hi Jochen

Thanks

Alan



Tue, 06 Sep 2005 10:09:56 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. openMP: threadprivate not effected and function variables not passed

2. I am not deaf, but am I mute?

3. php variables not passing through

4. session not passing variable

5. config xitami/php: variables not passed

6. GET variable not being passed?

7. Variable not passing in HTML form to PHP sendmail script

8. trouble with iis not passing variables

9. Variable Not Passed With $_SERVER['PHP_SELF']

10. Character variable variable passed as a subroutine argument

11. Pass variable to variable by reference?

12. RESULT: comp.databases.berkeley-db passes 266:4

 

 
Powered by phpBB® Forum Software