Photos Not View

Started on the old forum in August 2008 · view the original in the archive · old links redirect here

34 replies · 1,855 views · started 18 years ago · 1 min read

TL;DR · summary of 34 replies
  • $photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='.$who.' ORDER BY RAND()")); was not working as expected.
  • The code was changed to use $uid instead of $who for the query, but still had issues displaying images from different users' galleries.
  • A final solution was found by using a specific SQL query: $photo = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE uid='.$who.'")); which fetched the avatar image URL correctly.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

5 participants
inet Senior · 264 posts #21

CODE$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery ORDER BY RAND() limit 1"));

echo "<img src="$photo[0]" width="50" height="60" alt="$photo[0]"/>";

problem solved..

Services

Are you looking to take your wap or wapsite to a higher level? Do you want to stand out and rise above your competitors?

Below is a list of services I offer:

Wap Design and Customized Coding -The first way to stand out in a crowd is to have a brilliant and unique design for your wap or wapsite.

Rates

General consulting – My current hourly rate is $100 / hour. Custom Wapsite Community - My current rate is $500 / Wap Community Development.

inet Senior · 264 posts #24

but I wont add the gallery pics random before nickname at chat page...but this pics are from user write msg gallery...

use this final one hope this finaly resolves your problem

do not random the image but rather it displays image of the chatter

CODE$photo = mysql_fetch_array(mysql_query("SELECT avatarImageofChatter FROM ibwf_users WHERE uid='".$who.'" "));

CODE$photo = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE uid='".$who.'""));

CODE$photo = mysql_fetch_array(mysql_query("SELECT mypicture FROM ibwf_users WHERE uid='".$uid.'""));

Services

Are you looking to take your wap or wapsite to a higher level? Do you want to stand out and rise above your competitors?

Below is a list of services I offer:

Wap Design and Customized Coding -The first way to stand out in a crowd is to have a brilliant and unique design for your wap or wapsite.

Rates

General consulting – My current hourly rate is $100 / hour. Custom Wapsite Community - My current rate is $500 / Wap Community Development.

sweetangel Lead · 885 posts #25

I have add this:

$photo = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE uid='".$who.'"));

but:

Parse error: syntax error, unexpected '"'

🙁

if like my post click:

External image (may be gone)

inet Senior · 264 posts #26

I have add this:

$photo = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE uid='".$who.'"));

but:

Parse error: syntax error, unexpected '"'

:(

try this one!!! $photo = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE uid='".$who.'"'));

Services

Are you looking to take your wap or wapsite to a higher level? Do you want to stand out and rise above your competitors?

Below is a list of services I offer:

Wap Design and Customized Coding -The first way to stand out in a crowd is to have a brilliant and unique design for your wap or wapsite.

Rates

General consulting – My current hourly rate is $100 / hour. Custom Wapsite Community - My current rate is $500 / Wap Community Development.

sweetangel Lead · 885 posts #27

at this line:

        $photo = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE uid='".$who.'"')); 

I have:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

if like my post click:

External image (may be gone)

inet Senior · 264 posts #28

at this line:

        $photo = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE uid='".$who.'"')); 

I have:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

because you dont have this avatar in your sql... you must add it ....

what script you use today?

Services

Are you looking to take your wap or wapsite to a higher level? Do you want to stand out and rise above your competitors?

Below is a list of services I offer:

Wap Design and Customized Coding -The first way to stand out in a crowd is to have a brilliant and unique design for your wap or wapsite.

Rates

General consulting – My current hourly rate is $100 / hour. Custom Wapsite Community - My current rate is $500 / Wap Community Development.

Guest #29

Ok, now try this:

$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$chat[0]."' ORDER BY RAND() "));

          echo "<img src=\"$photo[0]\" width=\"50\" height=\"60\" alt=\"$photo[0]\"/>";
          echo "[$ds]<a href=\"chat.php?action=say2&amp;sid=$sid&amp;who=$chat[0]&amp;rid=$rid&amp;rpw=$rpw\">$optlink</a> - ";
          echo "".strtolower($tosay)."

";

sweetangel Lead · 885 posts #30

Ok, now try this:

$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$chat[0]."' ORDER BY RAND() "));

          echo "<img src=\"$photo[0]\" width=\"50\" height=\"60\" alt=\"$photo[0]\"/>";
          echo "[$ds]<a href=\"chat.php?action=say2&amp;sid=$sid&amp;who=$chat[0]&amp;rid=$rid&amp;rpw=$rpw\">$optlink</a> - ";
          echo "".strtolower($tosay)."

";

this work 😮 how I can add a image by default if 1 users not have photo ????

if like my post click:

External image (may be gone)

Guest #31

I think its this, I don't have my codes at work with me, doing it out of my head now.

$piccount = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gallery WHERE uid='".$chat[0]."'")); if ($piccount[0]>0){ $photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$chat[0]."' ORDER BY RAND() "));}else{ $photo[0] = "defaultpic.jpg"; }

echo "<img src="$photo[0]" width="50" height="60" alt="$photo[0]"/>"; echo "[$ds]<a href="chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw">$optlink</a> - "; echo "".strtolower($tosay)." ";

sweetangel Lead · 885 posts #33

I have code this:

else if($action=="phtch")
{
    addonline(getuid_sid($sid),"PhotoChat Panel","");
    $photochat = $_GET["photochat"];
    $photochat = ($photochat=="dis" ? 1 : 0);
      echo "<head>";
      echo "<title>Chat</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
      echo "</head>";
      echo "<body>";
  echo "<p align=\"center\">";
  //$uid = getuid_sid($sid);
  $res = mysql_query("UPDATE ibwf_users SET photochat='".$photochat."' WHERE id='".$uid."'");
  if($res)
  {
    echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Photos Chat Active
";
  }else{
    echo "<img src=\"../images/notok.gif\" alt=\"x\"/>error
";
  }
  echo "[b]0 [/b]<a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
  echo "</p></body>";
}

is good??? at ibwf users I have add a table photochat ... default is off...

if like my post click:

External image (may be gone)

crazybrumi Super moderator Principal · 1,064 posts #34

I have add this:

$photo = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE uid='".$who.'"));

but:

Parse error: syntax error, unexpected '"'

:(

jesus christ why dont yu learn sumthing, a wudv thort yu would nw what a syntax error is by now, yu can make these errors all the time i make em all the time fogeting to put a certain things in. Learn only way yu will progress

Want something coded email me at sales@webnwaphost.com for a prices.

http://flagcounter.com/more/W80q

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close