Jump to content

pctechtime

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.pctechtime.com

Profile Information

  • Gender
    Not Telling

pctechtime's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. This still doesn't fix the problem here are my answeres to your questions Hi. I'm a bit confused with the code since it appears that your form drop down selector is going to have one big choice of all three of those options in one option. $pulldown1 = '<option>Select One</option>'; [b]This make the Select One show up first in the drop down menu.[/b] Then two lines down you concatenate it with two other choices: $pulldown1 .= "<option value=\"{$row['order_number']}\">{$row['order_number']}) {$row['test_ordered']}</option>\n"; [b]This make the all of the rows show up in the drop down to show up order_number first and then ) and then the test_ordered in the drop down menu. example " 4) Gold "[/b] If I read this right it will produce a display of one option containing all three choices. Or maybe i'm not reading that right? This makes the above show up. Now I want to select number 4 Gold. When I press the button I want all the rows and colums data to show up in a list that where item_number 4 shows up only. remember 4 Gold was my selection above. Below is the code I have now. <?php     $usr = "***";     $pwd = "***";     $db = "***";     $host = "localhost";   // # connect to database     $cid = mysql_connect($host,$usr,$pwd);     mysql_select_db($db);     if (mysql_error()) { print "Database ERROR: " . mysql_error(); } // Create the pull-down menu information. $query1 = "SELECT order_number,client_name,test_ordered,salesperson,order_date FROM orders  ORDER BY order_number ASC"; $result1 = @mysql_query ($query1); $pulldown1 = '<option>Select One</option>'; while ($row = mysql_fetch_array ($result1, MYSQL_ASSOC)) { $pulldown1 .= "<option value=\"{$row['order_number']}\">{$row['order_number']}) {$row['test_ordered']}</option>\n"; } ?> <form name="orders" action="orderlookup.php" method="POST">    <table> <tr><td><b>Order Name: </b></td><td> <select name="order_number"> <?php echo $pulldown1; ?> </select> </td></tr></table> <p><input type="submit" value="View Results"></p> </th></tr></table> </form> <?php $query1 = "SELECT * FROM orders  WHERE order_number='$order_number' "; $results = mysql_query($query1); echo "<table><tr>         <th>Order Number</th>         <th>Client Name</th>         <th>Test Ordered</th>         <th>Date Ordered</th>         <th>Sales Person</th>         </tr>"; while ($row = mysql_fetch_array($results)) {       echo "<tr><td>" . $row['order_number'] . "</td><br><td>" . $row['client_name'] . "</td><td>" . $row['test_ordered'] . "</td><td>" . $row['order_date'] . "</td><td>" . $row['salesperson'] . "</td>               </tr>"; } echo "</table>\n"; ?> </body> </html>
  2. Below is what I have so far. My problem is I want select the clients name and number and view all of the infomation stored for that client in all the rows in the database. This must be in a table format with headers that I can name. Example clients_name would be Customers Name. Thanks for your help. Mike    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <?php     $usr = "888";     $pwd = "888";     $db = "888";     $host = "localhost";   // # connect to database     $cid = mysql_connect($host,$usr,$pwd);     mysql_select_db($db);     if (mysql_error()) { print "Database ERROR: " . mysql_error(); } // Create the pull-down menu information. $query1 = "SELECT order_number,client_name,test_ordered,salesperson,order_date FROM orders  ORDER BY order_number ASC"; $result1 = @mysql_query ($query1); $pulldown1 = '<option>Select One</option>'; while ($row = mysql_fetch_array ($result1, MYSQL_ASSOC)) { $pulldown1 .= "<option value=\"{$row['order_number']}\">{$row['order_number']}) {$row['test_ordered']}</option>\n"; } ?> <form name="orders" action="orderlookup.php" method="POST">    <table> <tr><td>Order Name: </td><td> <select name="order_number"> <?php echo $pulldown1; ?> </select> </td></tr></table> <p><input type="submit" value="View Results"></p> </th></tr></table> </form> <?php // this is processed when the form is submitted     // back on to this page (POST METHOD)     if ($_SERVER['REQUEST_METHOD'] == "POST")     {         # escape data and set variables         $order_number = addslashes($_POST["order_number"]);         $client_name = addslashes($_POST["client_name"]);         $test_ordered = addslashes($_POST["test_ordered"]);         $salesperson = addslashes($_POST["salesperson"]);         $order_date = addslashes($_POST["order_date"]);         } ?> </body> </html>
  3. Below is what I have so far. My problem is I want select the clients name and number and view all of the infomation stored for that client in all the rows in the database. This must be in a table format with headers that I can name. Example clients_name would be Customers Name. Thanks for your help. Mike    :-\ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 { color: #3300FF; font-weight: bold; } .style2 { color: #0033FF; font-weight: bold; } --> </style> </head> <body> <div align="center">   <h1 class="style1">Coin Database  </h1>   <h2 class="style1">Data Entry  </h2> </div> <p align="center" class="style2">Result List </p> <?php     $usr = "888";     $pwd = "888";     $db = "888";     $host = "localhost";   // # connect to database     $cid = mysql_connect($host,$usr,$pwd);     mysql_select_db($db);     if (mysql_error()) { print "Database ERROR: " . mysql_error(); } // Create the pull-down menu information. $query1 = "SELECT order_number,client_name,test_ordered,salesperson,order_date FROM orders  ORDER BY order_number ASC"; $result1 = @mysql_query ($query1); $pulldown1 = '<option>Select One</option>'; while ($row = mysql_fetch_array ($result1, MYSQL_ASSOC)) { $pulldown1 .= "<option value=\"{$row['order_number']}\">{$row['order_number']}) {$row['test_ordered']}</option>\n"; } ?> <form name="orders" action="orderlookup.php" method="POST">    <table> <tr><td><b>Order Name: </b></td><td> <select name="order_number"> <?php echo $pulldown1; ?> </select> </td></tr></table> <p><input type="submit" value="View Results"></p> </th></tr></table> </form> <?php // this is processed when the form is submitted     // back on to this page (POST METHOD)     if ($_SERVER['REQUEST_METHOD'] == "POST")     {         # escape data and set variables         $order_number = addslashes($_POST["order_number"]);         $client_name = addslashes($_POST["client_name"]);         $test_ordered = addslashes($_POST["test_ordered"]);         $salesperson = addslashes($_POST["salesperson"]);         $order_date = addslashes($_POST["order_date"]);         print "<p><font color=red>$order_number</a></font></p>"; print "<p><font color=red>$client_name</a></font></p>"; print "<p><font color=red>$test_ordered</a></font></p>"; print "<p><font color=red>$salesperson</a></font></p>"; print "<p><font color=red>$order_date</a></font></p>"; print "<p><font color=red>$pulldown2</a></font></p>"; } ?> </body> </html>
  4. In this line $d=date("D"); the $d is the var. what does the date do? and what does the ("D") do <html> <body><?php $d=date("D"); if ($d=="Fri")   {   echo "Hello!<br />";   echo "Have a nice weekend!";   echo "See you on Monday!";   } ?></body> </html>
  5. I am trying to input a string of numbers and have it go into 4 different fields of a database. See below Any help would be great. data to input 0215446912345678 scan_field          // this is the field the above number would go into and also needs to be broken up into the fields below item_number      // this is the field the first 6 numbers would go into grade                // this is the field the next 2 numbers would go into serial_number    // this is the field the last numbers would go into (the last set of numbers can be 1 to many in length
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.