Jump to content


Photo

weird


  • Please log in to reply
8 replies to this topic

#1 DarthViper3k

DarthViper3k
  • Members
  • PipPipPip
  • Advanced Member
  • 50 posts

Posted 15 June 2003 - 06:23 PM

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
[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]
switch($php) {
    case = \"given\" : {
       $website = 1;
       break;
    }     case = \"taught\" : {        $website = lifetime;        break;     } } [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] The lazy never learn. The lazy are the downfall of many great things. Take the time to learn.

#2 Nevets

Nevets
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 15 June 2003 - 07:13 PM

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

#3 Galewind

Galewind
  • Members
  • Pip
  • Newbie
  • 2 posts

Posted 15 June 2003 - 07:53 PM

You could try changing your query to
[php:1:0dd9a3fe87]$buddy_query = mysql_query(\"SELECT * FROM buddys WHERE UserID= \'$userid\'\");[/php:1:0dd9a3fe87]

#4 DarthViper3k

DarthViper3k
  • Members
  • PipPipPip
  • Advanced Member
  • 50 posts

Posted 15 June 2003 - 08:11 PM

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:
[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]
switch($php) {
    case = \"given\" : {
       $website = 1;
       break;
    }     case = \"taught\" : {        $website = lifetime;        break;     } } [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] The lazy never learn. The lazy are the downfall of many great things. Take the time to learn.

#5 Blu_Smurf

Blu_Smurf
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts
  • LocationTexas

Posted 15 June 2003 - 08:19 PM

Hehe we all ahve our days

#6 DarthViper3k

DarthViper3k
  • Members
  • PipPipPip
  • Advanced Member
  • 50 posts

Posted 15 June 2003 - 08:22 PM

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
[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]
switch($php) {
    case = \"given\" : {
       $website = 1;
       break;
    }     case = \"taught\" : {        $website = lifetime;        break;     } } [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] The lazy never learn. The lazy are the downfall of many great things. Take the time to learn.

#7 Blu_Smurf

Blu_Smurf
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts
  • LocationTexas

Posted 15 June 2003 - 10:03 PM

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

#8 DarthViper3k

DarthViper3k
  • Members
  • PipPipPip
  • Advanced Member
  • 50 posts

Posted 16 June 2003 - 12:05 AM

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:
[!--PHP-Head--][div class=\'phptop\']PHP[/div][div class=\'phpmain\'][!--PHP-EHead--]
switch($php) {
    case = \"given\" : {
       $website = 1;
       break;
    }     case = \"taught\" : {        $website = lifetime;        break;     } } [/span][!--PHP-Foot--][/div][!--PHP-EFoot--] The lazy never learn. The lazy are the downfall of many great things. Take the time to learn.

#9 Blu_Smurf

Blu_Smurf
  • Members
  • PipPipPip
  • Advanced Member
  • 32 posts
  • LocationTexas

Posted 16 June 2003 - 12:26 AM

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users