DarthViper3k Posted June 15, 2003 Share Posted June 15, 2003 this is the weirdest thing I\'ve come across now I\'m programing a buddy list heres the code I have in functions.php [php:1:9d148a5007] <?php function viewbuddies() { ?><TABLE WIDTH=\"70%\" BGCOLOR=\"333333\" border=0> <TR> <TD colspan=2> <TABLE WIDTH=\"100%\"><?php $buddy_query = mysql_query(\"SELECT * FROM buddys WHERE UserID=$userid\"); while ($buddies = @mysql_fetch_array($buddy_query)) { ?><TR BGCOLOR=\"444444\"> <TD width=\"33%\"><?php echo $buddies[\'BuddyName\'] ?>BuddyName</TD> <TD width=\"33%\"><a href=\'pm.php\'>PM</a></TD> <TD width=\"33%\"><a href=\'email.php\'>email</a></TD> </TR> <?php } ?> </TABLE> </TD> </TR> </TABLE> <?php } ?> [/php:1:9d148a5007] when I have it like that I get absolutely nothing but when I remove \"WHERE UserID=$userid\" I get every buddy in the buddy table does ANYBODY have ANY ideas as to whats goin on?? edit: nevermind... I figured it out I can\'t believe I was so stupid Quote Link to comment https://forums.phpfreaks.com/topic/596-weird/ Share on other sites More sharing options...
Nevets Posted June 15, 2003 Share Posted June 15, 2003 just for curiositys sake, was the variable spelled wrong in one place or another? Quote Link to comment https://forums.phpfreaks.com/topic/596-weird/#findComment-1994 Share on other sites More sharing options...
Galewind Posted June 15, 2003 Share Posted June 15, 2003 You could try changing your query to [php:1:0dd9a3fe87]$buddy_query = mysql_query(\"SELECT * FROM buddys WHERE UserID= \'$userid\'\");[/php:1:0dd9a3fe87] Quote Link to comment https://forums.phpfreaks.com/topic/596-weird/#findComment-1995 Share on other sites More sharing options...
DarthViper3k Posted June 15, 2003 Author Share Posted June 15, 2003 to solve yalls curiosity the function to view buddies didn\'t have the variable when I echoed $userid I echoed it OUTSIDE the function if you look $userid wasn\'t inside the () for the function I just forgot to pass the variable into the function :oops: :? :oops: :oops: Quote Link to comment https://forums.phpfreaks.com/topic/596-weird/#findComment-1996 Share on other sites More sharing options...
Blu_Smurf Posted June 15, 2003 Share Posted June 15, 2003 Hehe we all ahve our days Quote Link to comment https://forums.phpfreaks.com/topic/596-weird/#findComment-1997 Share on other sites More sharing options...
DarthViper3k Posted June 15, 2003 Author Share Posted June 15, 2003 Hehe we all ahve our days yea well I\'ve been workin on this EXTREMELY large php system of mine for so long I\'m starting to miss small details here and there and most of \'em is passing a variable :oops: :oops: lets say this I\'m so embarrased that I took this large 1 liter bottle of Gatorade and started hitin myself upside the head lol Quote Link to comment https://forums.phpfreaks.com/topic/596-weird/#findComment-1998 Share on other sites More sharing options...
Blu_Smurf Posted June 15, 2003 Share Posted June 15, 2003 lol yeah I was that way the other day myself... I am making one php system that\'s a msg board, shout out, admin program, login/register and a few other things as awell as news... Let me tell ya, it\'s not easy piecing everything together lol Quote Link to comment https://forums.phpfreaks.com/topic/596-weird/#findComment-2000 Share on other sites More sharing options...
DarthViper3k Posted June 16, 2003 Author Share Posted June 16, 2003 lol yeah I was that way the other day myself... I am making one php system that\'s a msg board, shout out, admin program, login/register and a few other things as awell as news... Let me tell ya, it\'s not easy piecing everything together lol figures I\'m doin the same thing but its gonna have a couple other things you didn\'t list :wink: Quote Link to comment https://forums.phpfreaks.com/topic/596-weird/#findComment-2001 Share on other sites More sharing options...
Blu_Smurf Posted June 16, 2003 Share Posted June 16, 2003 hehe yeah that\'s why I said a few other things, I don\'t feel like pulling out my list of feathures lol... I wanna try to get it out in the GNU community some time soon and maybe get a job from it lol Quote Link to comment https://forums.phpfreaks.com/topic/596-weird/#findComment-2002 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.