...

View Full Version : help with that php/mysql issue



maxwel
01-30-2012, 12:24 PM
<?php

$MYSQL_HOST = "localhost";
$MYSQL_USER = "wwwmoreb_wildli1";
$MYSQL_PW = "rambo12";
$MYSQL_DB = "wwwmoreb_MBRChat";


$conn = mysql_connect($MYSQL_HOST, $MYSQL_USER, $MYSQL_PW);
mysql_select_db($MYSQL_DB, $conn);

$names = "";

$chatuser = mysql_query("SELECT * FROM pcpin_nickname WHERE pcpin_nickname.default = 'y';");
$chatuserid = mysql_query("SELECT * FROM pcpin_user_id WHERE pcpin_user_id.primary = 'y';");

while($row = mysql_fetch_assoc($chatuser)&($chatuserid)) {
$names .= '<img src="'.$row['user_id'].'" align="absmiddle">'.$row['nickname_plain'].'<br><br>';
}

// $names = substr($names, 0, -5);

echo ' <marquee behavior="scroll" direction="up" scrollamount="5" scrolldelay="200" onmouseover="this.scrollAmount=0" onmouseout="this.scrollAmount=5""this.scrolldelay=200">'.$names.' </marquee>';


?>


i am trying to show avatar picture of every pcpin chat user and here comes the issue it don wanna show beside each user name there is sumthing wrong with the avatar/img themselves

been like 10 hours tryin

any idea?
thanks in advance

mlseim
01-30-2012, 12:31 PM
Are the images stored in a directory, or within your mysql database table?
I'm talking about the actual image, not just the image filename.

maxwel
01-30-2012, 12:53 PM
database not directory

maxwel
01-30-2012, 03:30 PM
still didn't get any help for that

anyone got any idea?

mlseim
01-30-2012, 07:19 PM
Take a look at all of the columns in your MySQL table
and tell us which one of those contains the actual image.
It's going to be a binary type column.

I'm guessing that the column named 'user_id' is not the column that stores the image.

<img src="'.$row['user_id'].'" align="absmiddle">

To display "BLOB" images from a mysql table, you need a stand-alone script
that will display the binary image file in the correct mime-type.

See this:
http://www.phpbuilder.com/board/showthread.php?t=10252369

That's why it's easier to store images in a directory and store the image filename only in the table.


.

maxwel
01-30-2012, 08:46 PM
opk the other issue has been fixed

and when i browse pcpin_avatar these are the colums that appear


1 id int(11) No None AUTO_INCREMENT
2 user_id int(11) No 0
3 primary enum('y', 'n') utf8_general_ci No y
4 binaryfile_id int(11) No 0



actually i kind of got what is wrote in the link u gave me but i am not that pro with php n i donno where to place the db ingo in those scripts and wheather that one will go with ma chat or not. idk :S
any idea?

mlseim
01-31-2012, 01:48 AM
Let's back up a second to the first post.

Do you know for sure there are avatars stored in the database?
Is there a place elsewhere in your script where avatars are displayed?
And how do the avatars get into the database?

maxwel
01-31-2012, 01:39 PM
i am not sure about all of that. the pcpin chat is free ajax chat for all but not sure of all these stuff u askin about :S

mlseim
01-31-2012, 01:57 PM
Are you trying to modify their script to show an avatar in a place
where it's not showing, or are you writing a stand-alone script to
show avatars from the database ... but your script is not part of
pcpin chat?

I'm trying to determine if you're modifying their script, or creating your own.


EDIT:
I see they have something called the "avatar gallery". When you run the chat,
can you do something where you can view all of the avatars on a web page?
If so, do that and copy the HTML ... post that for me here.


.

maxwel
01-31-2012, 05:44 PM
http://morebassradio.com/MBRChat/index.php?inc=show_image&img_b_id=255&s_id=osufcpGwqO85powEeQUeRYv8BF4pjEZ5

sumthing like that? i got that link when i got in my profile and then pressed on one of (actually the primary or default) my avatar.

is that what u meant?

maxwel
02-01-2012, 01:53 PM
any idea?

maxwel
02-02-2012, 08:41 PM
any help please???



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum