473,467 Members | 1,398 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Issue passing a value

Chrisjc
375 Contributor
First off here is the link to my page

Link to page

I am having an issue passing the "State" value to "dealerlocater.php" page that I have created, I have my index.php which will pull from my database and list all the States in a drop down.

I now am trying to pass a selected state to “dealerlocater.php” which in return would post up all entries found in the database.

How ever I am having an issue with my code could some one please take a look-see and let me know what I am missing here? Iv been stuck on this for a few days now. =(

Here is my code to index.php
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. // =========================================================
  3. //  Populate the state selection list from the database
  4. // =========================================================
  5. echo '<form action="dealerlocater.php" method="post">';
  6. echo '<select id="state" name="state" style="margin-bottom:4px;font-family: Tahoma; font-size: 10pt; height:28px;width:184px;">';
  7. echo '<option value="">Select Your State</option>';
  8. // =========================================================
  9. // Connection to the Database
  10. // =========================================================
  11. include ('db functions/db_connect.php');
  12. // =========================================================
  13. // SELECT state to make drop down list
  14. // =========================================================
  15. $res = mysql_query("SELECT state FROM dealerlocater GROUP BY state ORDER BY state")
  16.    or die("Invalid query: " . mysql_query());
  17. while ($row = mysql_fetch_assoc($res)) {
  18.    $st = $row['state'];
  19.    echo "<option value='$st'>$st</option>";
  20. }
  21. echo '</select>';
  22. echo '<br>';
  23. echo '<input type="submit" name="Submit" value="Submit">';
  24. ?>
  25. </form>
  26.  

and here is the code to "dealerlocater.php"
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. // =========================================================
  3. // Connection to the Database
  4. // =========================================================
  5. include ('db functions/db_connect.php');
  6. mysql_select_db($dealerlocater);
  7.  
  8. $query= "select * from dealerlocater where * '" . $_POST['*'] . "'"; 
  9. echo $query; 
  10.  
  11. $result= mysql_query($query); 
  12. $num_results = mysql_num_rows($result); 
  13.  
  14. for ($i=0; $i <$num_results; $i++) 
  15. $row = mysql_fetch_array($result); 
  16. echo "state: ", $row['state'], ": ",$row['state']; 
  17. ?>
  18.  
Once I can get the value passed and it knows what to only look for calling on the columns I wish to display will be rather easy.
Jan 15 '08 #1
1 1283
Chrisjc
375 Contributor
Can be closed.


Fixed topic... other issues however we seem to be short experts. Found help via another MB.
Jan 15 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Miranda johnsen | last post by:
Hello, I need some help with passing a value from my login authorization page. The authorization is done with the code below (it works), but I need the 'uName' value passed on when the...
8
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
9
by: Bob Achgill | last post by:
I really like this function but have tried to slow down on using it because I get a 1 second pause each time I use it. I don't really understand why the computer has to think for 1 second! ...
6
by: MSDNAndi | last post by:
Hi, I get the following warning: "Possibly incorrect assignment to local 'oLockObject' which is the argument to a using or lock statement. The Dispose call or unlocking will happen on the...
12
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
17
by: sureshjayaram | last post by:
I have problem with the code only with 64 bit big endian machine. i have a member size_t val1 in my structure. The size of size_t is 32(unsigned int) in 32 bit machines and 64(unsigned long) in 64...
2
by: Paul | last post by:
I've written som junk code below to show a problem I'm getting: On a page I've got a dropdownlist and a button using submit behaviour: <asp:DropDownList ID="tester" runat="server"...
12
by: puzzlecracker | last post by:
Here is a dummy program that outputs 4 instead of 200. I suspect it's because it calculates the size of pointer on 32 bit machines instead of array. Is there way to make it print 200? I need to...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.