Jump to content

weird


DarthViper3k

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

Link to comment
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:

Link to comment
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

Link to comment
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

Link to comment
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:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.