Jump to content

Archived

This topic is now archived and is closed to further replies.

DarthViper3k

weird

Recommended Posts

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

Share this post


Link to post
Share on other sites

just for curiositys sake, was the variable spelled wrong in one place or another?

Share this post


Link to post
Share on other sites

You could try changing your query to

[php:1:0dd9a3fe87]$buddy_query = mysql_query(\"SELECT * FROM buddys WHERE UserID= \'$userid\'\");[/php:1:0dd9a3fe87]

Share this post


Link to post
Share on other sites

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:

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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:

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.