General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 19th, 2003, 02:37 AM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
problem with query sending results?

okay here is my problem (as best I understand it):
I have a profile page which shows different user info. I then have a navigation page which I can put at the top of the page and make the query through that and output results on viewprofile page. Then thre is the search page to find users, which query's in the nav page, and is passed to view profile.
Pretty simple.
But I seem to have a problem with the results of the search: when I am looking just at id, it works fine (a simple query is made to jsut find that id); but when I'm looking at the query made with multiple items, it won't work well; it returns the users, but won't get certain info.
this is the nav page:
PHP Code:
if($page == 'viewprofile')
    { if(
$_GET['strMethod'] == 'search')
        { if(
$_GET['age'] != '')
            { 
$age date("Y") - $_GET['age']; }    
                if(
$_GET['both'] == 'on')
                    { 
$gender '"male" OR sex = "female"'; } else if($_GET['female'] == 'female')
                        { 
$gender '"female"'; } else if($_GET['male'] == 'male')
                            {  
$gender '"male"'; }
$selection 'userid, username';
$db 'users';
$params 'pending = "no" AND 
            username LIKE "%' 
$_GET['name'] . '%" AND
            location LIKE "%' 
$_GET['location'] . '%" AND
            year LIKE "%' 
$age '%" AND
            userinfo LIKE "%' 
$_GET['infoSearch'] . '%" AND
            sex = ' 
$gender;
$sortBy $_GET['sortBy'];
$direction $_GET['direction'];
        
} }

// Define your basic query
$query_in "SELECT " 
            
$selection 
            
" FROM " 
            
$db 
            
" WHERE " 
            
$params .  
            
" ORDER BY " 
            
$sortBy " " .  
            
$direction 
            
""

that's the basic page.
the other option is to fetch according to userid; i will put this into the nav page later, but for now its on my view profile page...
PHP Code:
 $query mysql_query("SELECT * FROM users WHERE userid = " $userid); 

i then use a while() to return the results in an array.

I noticed it had troble with this:
$userid = $myrow['userId'];
my table says userId, but when I return based on a url $_GET['userid'], it won't work, but the search funtion will... what's teh difference?
And the search won't return things like $myrow['location']... it seems to be coming back empty? Do I have to do mysql_fetch_row isntead? the downside is if I change my table, I hav to fix the page in major ways. Why is this happening?
thanks
I hope that was enough info...
__________________
hey it's the CHARKING

Reply With Quote
  #2  
Old October 19th, 2003, 02:48 AM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
oh :P

I FIXED IT oi

made query to say select userId

i guess ill leave this here... so people can try to... look at it?

////CHANGE it to say select * duh cant jsut get those two!
man im too tired.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > problem with query sending results?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway