Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Jan 2012
    Posts
    63
    Thanks
    18
    Thanked 0 Times in 0 Posts

    help with that php/mysql issue

    PHP Code:
    <?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

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,512
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    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.

  • Users who have thanked mlseim for this post:

    maxwel (02-02-2012)

  • #3
    New Coder
    Join Date
    Jan 2012
    Posts
    63
    Thanks
    18
    Thanked 0 Times in 0 Posts
    database not directory

  • #4
    New Coder
    Join Date
    Jan 2012
    Posts
    63
    Thanks
    18
    Thanked 0 Times in 0 Posts
    still didn't get any help for that

    anyone got any idea?

  • #5
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,512
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    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/show...php?t=10252369

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


    .
    Last edited by mlseim; 01-30-2012 at 07:22 PM.

  • Users who have thanked mlseim for this post:

    maxwel (01-30-2012)

  • #6
    New Coder
    Join Date
    Jan 2012
    Posts
    63
    Thanks
    18
    Thanked 0 Times in 0 Posts
    opk the other issue has been fixed

    and when i browse pcpin_avatar these are the colums that appear

    Code:
    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?
    Last edited by maxwel; 01-30-2012 at 08:56 PM.

  • #7
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,512
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    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?

  • Users who have thanked mlseim for this post:

    maxwel (01-31-2012)

  • #8
    New Coder
    Join Date
    Jan 2012
    Posts
    63
    Thanks
    18
    Thanked 0 Times in 0 Posts
    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

  • #9
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,512
    Thanks
    8
    Thanked 1,090 Times in 1,081 Posts
    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.


    .
    Last edited by mlseim; 01-31-2012 at 01:59 PM.

  • Users who have thanked mlseim for this post:

    maxwel (01-31-2012)

  • #10
    New Coder
    Join Date
    Jan 2012
    Posts
    63
    Thanks
    18
    Thanked 0 Times in 0 Posts
    http://morebassradio.com/MBRChat/ind...UeRYv8BF4pjEZ5

    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?

  • #11
    New Coder
    Join Date
    Jan 2012
    Posts
    63
    Thanks
    18
    Thanked 0 Times in 0 Posts
    any idea?

  • #12
    New Coder
    Join Date
    Jan 2012
    Posts
    63
    Thanks
    18
    Thanked 0 Times in 0 Posts
    any help please???


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •