Thread: search issue
View Single Post
  #1  
Old 08-22-2006, 12:42 PM
terryo terryo is offline
Junior Member
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
terryo is on a distinguished road
Default search issue

Hi

When my users register they fill out the county they live in. They can then go and search for suppliers in that county, or (for flexibility) search on other counties. The problem I have is that I can get my drop down to display the county that the user lives in but then I need to search for suppliers against that who are obviously in a different table. It is the code that searches for the supplier that is not working (no errors).

My code look slike so:

PHP Code:
$id = $_SESSION['username'];
$query1 = "select * from users where username='$id'";

//now we pass the query to the database
$result1=mysql_query($query1) or die("Could not get data.".mysql_error());

//get the first (and only) row from the result
$row = mysql_fetch_array($result1, MYSQL_ASSOC);

$county=$row['county'];
?>

<html>
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - search issue
Thread: search issue
View Single Post
  #1  
Old 08-22-2006, 12:42 PM
terryo terryo is offline
Junior Member
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
terryo is on a distinguished road
Default search issue

Hi

When my users register they fill out the county they live in. They can then go and search for suppliers in that county, or (for flexibility) search on other counties. The problem I have is that I can get my drop down to display the county that the user lives in but then I need to search for suppliers against that who are obviously in a different table. It is the code that searches for the supplier that is not working (no errors).

My code look slike so:

PHP Code:
$id = $_SESSION['username'];
$query1 = "select * from users where username='$id'";

//now we pass the query to the database
$result1=mysql_query($query1) or die("Could not get data.".mysql_error());

//get the first (and only) row from the result
$row = mysql_fetch_array($result1, MYSQL_ASSOC);

$county=$row['county'];
?>

<html>
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote