» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #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
Revenue Sharing Ads ( ?):
  #2  
Old 08-22-2006, 12:45 PM
prestor prestor is offline
OSP Starters
 
Join Date: Aug 2006
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
prestor is on a distinguished road
Default

PHP Code:
$numrows=mysql_num_rows($numresults);
$row = mysql_fetch_array($numresults, MYSQL_ASSOC);

what is the logic behind this?

in first line you are fetching results as rows and in the second line as array.

i think you should remove one of them and your code will work. also check your $country is accessible in this query. Always print your queries to see their actual shape it helps to remove errors e.g blank variables without values or syntax errors and typos.. -- 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
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The future of Internet: Real-time Web Search and the Semantic Web waqar Premium Webmaster Articles 0 10-30-2006 06:41 AM
Oracle Unveils Oracle Secure Enterprise Search 10g outsourcingplans Web Hosting Industry 0 03-03-2006 04:42 PM
Ask Jeeves Launches Proprietary Image Search Technology outsourcingplans Web Hosting Industry 0 01-26-2006 07:05 PM
Navisso Search Launches Beta Test outsourcingplans Web Hosting News 0 01-04-2006 02:58 PM
Google Personalized Search Unleashed! outsourcingplans Web Hosting News 0 12-01-2005 03:44 PM


All times are GMT. The time now is 10:14 AM.