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
SW
this is my code:
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$who."' ORDER BY RAND() "));
echo "<img src=\"$photo\" 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)."
";
but photos not open....any1 can help me to fix this problem?? 🙂
CR
crazybrumi
Super moderator Principal · 1,064 posts
18 years ago
#2
what does ya imageurl consist of? where are the images saved. are the save in say images.
so in wapdesire itl b in web case
../web/images/$photo ?
try that
SW
not open 🙁 I have usergallery root into /web but not open...table ibwf_gallery not have the $who, but id,uid,imageurl,sex and time...:(
SW
IN
inet
Senior · 264 posts
18 years ago
#5
not open 🙁 I have usergallery root into /web but not open...table ibwf_gallery not have the $who, but id,uid,imageurl,sex and time...:(
$who is the same as uid
CODE$who= $_GET["uid"];
just try your best luck!
I salute sweetangel she got good ideas...
s He has many ideas...
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.
AM
amylee
Principal · 1,092 posts
18 years ago
#6
this is why people make backups before editing scripts so if they fuckup they can just restore the backup maybe you should try it sweetangel
SW
I have at chat.php page
$message =$_POST["message"];
$who = $_POST["who"];
but at gallery I have uid,id,imageurl,sex,time
at my code:
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$who."' ORDER BY RAND() "));
echo "<img src=\"$photo\" 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 I think is correct...but not work...😢
IN
inet
Senior · 264 posts
18 years ago
#8
I have at chat.php page
$message =$_POST["message"];
$who = $_POST["who"];
but at gallery I have uid,id,imageurl,sex,time
at my code:
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$who."' ORDER BY RAND() "));
echo "<img src=\"$photo\" 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 I think is correct...but not work...😢
post here the sql of your gallery...
and i will study it...
then your chat page...
i see you have trouble with that script almost 3 weeks ago...
and i see you in different forums posting the same problem...
may be i can help....you
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
this is my sql 4 ibwf_gallery
CREATE TABLE `ibwf_gallery` (
`id` int(100) NOT NULL auto_increment,
`uid` int(100) NOT NULL default '0',
`imageurl` varchar(100) NOT NULL default '',
`sex` char(1) NOT NULL default '',
`time` int(100) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1407;
INSERT INTO `ibwf_gallery` (`id`, `uid`, `imageurl`, `sex`, `time`) VALUES
(1, 751, '[url]http://myhost.com/web/usergallery/sweetangel.jpg'[/url], 'F', 1213127337),
GU
Try This:
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$who."' 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
GU
check my post, check the changes in red
SW
I have replace my code with your but not work now...:( not show images...:(
SW
methos but why this code ??
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$who."' ORDER BY RAND() "));
at my sql table not have who :?:
IN
inet
Senior · 264 posts
18 years ago
#15
methos but why this code ??
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$who."' ORDER BY RAND() "));
at my sql table not have who :?:
then replace $who to $uid
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$uid."' ORDER BY RAND() "));
this may work........
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 try now... 😉 GooD MoRNINg BuDDy 😀
IN
inet
Senior · 264 posts
18 years ago
#17
Try This:
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$chat."' 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 is ok! 😮
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
with this code I view the photo...but are only my photos at all nicknames...:o
IN
inet
Senior · 264 posts
18 years ago
#19
with this code I view the photo...but are only my photos at all nicknames...:o
yes this works... right?
CODE$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$uid."' ORDER BY RAND() "));
or use this one................................... this will help you...............
for all the pictures in your ibwf gallery this works fine for me on my fourth domain!
CODE$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery ORDER BY RAND() "));
CODE$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery ORDER by RAND() LIMIT 1"));
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
this is my code:
$photo = mysql_fetch_array(mysql_query("SELECT imageurl FROM ibwf_gallery WHERE uid='".$who."' ORDER BY RAND() "));
echo "<img src=\"$photo\" 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)."
";
but photos not open....any1 can help me to fix this problem?? 🙂
post full code