Forums / WEB Site / Script testing and error fixing
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.
Sort replies:
Oldest
Top voted
Newest
IN
inet
Senior · 264 posts
18 years ago
#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.
SW
but I wont add the gallery pics random before nickname at chat page...but this pics are from user write msg gallery...
SW
Warning : mysql_fetch_array(): supplied argument is not a valid MySQL result resource 😢
IN
inet
Senior · 264 posts
18 years ago
#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.
SW
I have add this:
$photo = mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE uid='".$who.'"));
but:
Parse error: syntax error, unexpected '"'
🙁
IN
inet
Senior · 264 posts
18 years ago
#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.
SW
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
IN
inet
Senior · 264 posts
18 years ago
#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.
GU
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&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
echo "".strtolower($tosay)."
";
SW
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&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
echo "".strtolower($tosay)."
";
this work 😮 how I can add a image by default if 1 users not have photo ????
GU
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)."
";
SW
good 😉 now 4 perfect work add option 4 user view / not view images before the user nickname...;)
SW
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...
CR
crazybrumi
Super moderator Principal · 1,064 posts
18 years ago
#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
RU
Any staff closing this topic will be good because I am tired of seeing bitterdemon's stupidity