Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
selecting data from database
Old 03-31-2008, 10:42 AM selecting data from database
Junior Talker

Posts: 3
Trades: 0
Basically this page selects the name of a product from a pull down box and sends the variables 'stock' and 'quantity' to the process.php form which in turn forwards and email automatcially.

I need this page to pull down other variables such as description, name and amountInStock when an item of stock is pulled down from the select box and forwarded to the process page. The process page selects data from the order page by:

$quantity = $_POST['quantity'];
$item = $_POST['stock'];

i need the other variables to be selected the same way.


Code:
<?php
session_start();
include("header.php");


echo "<form action='process.php' method='post'>";
    echo "Select stock:<br>";

   if(!isset($_GET['to']))
   {
     $query = "SELECT * FROM stock";
   }

   $con = makeConn();
   $resultUsers = mysql_query($query);
   if (mysql_num_rows($resultUsers) > 0){
    echo "<select name='stock'>";
    while ($row = mysql_fetch_array($resultUsers)){
     echo "<option value='" . $row['stockID'] . "'>" . $row['name'] . "</option>\n";
    }
    echo "</select>";
   }else{
    echo msgError("Error: Your message was not sent.");
   }
echo "Quantity: <input name='quantity' type='text' />";
echo "<input type='submit' />";
echo "</form>";

include("footer.php");
?>
oneski is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-01-2008, 11:46 AM Re: selecting data from database
Junior Talker

Posts: 4
Trades: 0
What other variables? Your script appears to be in order. What is the exact problem?
__________________

Please login or register to view this content. Registration is FREE

morinthos is offline
Reply With Quote
View Public Profile Visit morinthos's homepage!
 
Reply     « Reply to selecting data from database
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20338 seconds with 12 queries