1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Simple thing that i dont know!

Discussion in 'PHP' started by prilep, Jan 23, 2007.

  1. prilep

    prilep Well-Known Member

    Messages:
    3,852
    Likes Received:
    228
    Best Answers:
    0
    Trophy Points:
    185
    #21
    Everything looks okay in phpmyadmin its just that the image dosent show.
    SEMrush
    :(

    - Prilep :(
     
    prilep, Jan 23, 2007 IP
    SEMrush
  2. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #22
    OK if it is just a test database you can send it over or just rar/zip it and upload it somewhere. I really don't know what might be causing this.
     
    maiahost, Jan 24, 2007 IP
  3. prilep

    prilep Well-Known Member

    Messages:
    3,852
    Likes Received:
    228
    Best Answers:
    0
    Trophy Points:
    185
    #23
    I asked on other forums. No one knows :(

    this is the sql

    
    -- 
    -- Table structure for table `news_posts`
    -- 
    
    CREATE TABLE `news_posts` (
      `id` int(11) NOT NULL auto_increment,
      `title` varchar(70) NOT NULL default '',
      `avatar` varchar(255) NOT NULL default '',
      `author` varchar(50) NOT NULL default '',
      `post` text NOT NULL,
      `date` datetime NOT NULL default '0000-00-00 00:00:00',
      PRIMARY KEY  (`id`)
    ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
    
    
    PHP:
     
    prilep, Jan 24, 2007 IP
  4. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #24
    That's not of much use - can you dump a few lines (just a few!!) of the table so we check that the 'avatar' field is not empty?

    Also, did you copy and past on this forum the EXACT code you have on your script? Don't re-write it, copy and paste it as it is - otherwise we could lose some typos you might have in the original code
     
    picouli, Jan 24, 2007 IP
  5. pr0xy122

    pr0xy122 Peon

    Messages:
    1,649
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    0
    #25
    I recommend experts exchange for this.
     
    pr0xy122, Jan 24, 2007 IP
  6. chopsticks

    chopsticks Active Member

    Messages:
    565
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #26
    Yeh, let us see a dump and your exact code for this so we can help you. Much cheaper than using the Experts Exchange.
     
    chopsticks, Jan 24, 2007 IP
  7. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #27
    There are enough experts here, no need to go anywhere else... ;)
     
    picouli, Jan 24, 2007 IP
  8. prilep

    prilep Well-Known Member

    Messages:
    3,852
    Likes Received:
    228
    Best Answers:
    0
    Trophy Points:
    185
    #28
    The dump..

    
    INSERT INTO `news_posts` VALUES (3, 'Just Testing', 'http://www.immixstudios.com/work/Templates/Avatars/tbthosting.jpg', 'Prilep', 'Just TestingJust TestingJust Testing Just TestingJust TestingJust Testing Just TestingJust TestingJust Testing Just TestingJust TestingJust Testing Just TestingJust TestingJust Testing Just TestingJust TestingJust Testing Just TestingJust TestingJust Testing ', '2007-01-23 08:55:53');
    
    INSERT INTO `news_posts` VALUES (8, 'adaSDjh', 'http://www.immixstudios.com/work/Templates/Avatars/tbthosting.jpg', 'asjdhasd', 'ADklasjdkasdj\r\nADklasjdkasdj\r\nADklasjdkasdj\r\nADklasjdkasdj\r\nADklasjdkasdj\r\n', '2007-01-23 10:58:35');
    
    PHP:
     
    prilep, Jan 24, 2007 IP
  9. picouli

    picouli Peon

    Messages:
    760
    Likes Received:
    89
    Best Answers:
    0
    Trophy Points:
    0
    #29
    Seems ok to me... Copy and paste the code (please COPY AND PASTE IT, don't re-write it) - also you might want to add a
    print_r($row);
    PHP:
    in your loop to check what the heck is in there.

    Maaan I hate when these things happen! :mad:

    Also, what is the URL of your script? Can you put the full script source online so that I can give a better look at it?
     
    picouli, Jan 24, 2007 IP
  10. prilep

    prilep Well-Known Member

    Messages:
    3,852
    Likes Received:
    228
    Best Answers:
    0
    Trophy Points:
    185
    #30
    this is the whole news.php

    
    <html>
    <head>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
    function openComments(url)
    {
    comments = window.open(url, "Comment", "menubar=0,resizable=0,width=380,height=480")
    comments.focus()
    }
    </script>
    </head>
    <body>
    <?php
    include ('mysql_connect.php');
    $query = "SELECT id, title, avatar, author, post, DATE_FORMAT(date, '%M %d, %Y') as sd FROM news_posts ORDER BY date DESC LIMIT 2";
    $result = @mysql_query($query);
    
    
    
    if ($result) {
    while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    $url = 'comments.php?id='.$row['id'];
    echo '
    <div id=\"right\">
    
    
    <img src=\"'.$row['avatar'].'\" style=\"border: 1px dashed #1079D6\"
    <div id=/"maincontent/">
    
    <center><h3><font size="1" face="Verdana">'.$row['title'].' | Íàïèøàíî ía: '.$row['sd'].' Íàïèøàë: '.$row['author'].'</font></h3></center><br />
    
    '.$row['post'].'<br />
    <a href="javascript:openComments(\''.$url.'\')">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Äîäàäè/Âèäè íîâè êîìåíòàðè</a></p>';
    }
    } else {
    echo 'There are no news posts to display';
    }
    ?>
    </body>
    </html>
    
    PHP:
     
    prilep, Jan 24, 2007 IP
  11. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #31
    OK here's a test I just did :
    ibgco.com/test/1.php
    with one of your values (except I didn't use your insert cause it is auto_increment). You can see that it works just fine over here ...
    Also I have just noticed something in your query :
    Please remove "as sd" from it and test it again.
     
    maiahost, Jan 24, 2007 IP
  12. prilep

    prilep Well-Known Member

    Messages:
    3,852
    Likes Received:
    228
    Best Answers:
    0
    Trophy Points:
    185
    #32
    So how come it works on yours but not on mine? I just tryed a different script with an image like this one and it works fine. Its just that one that dosent work :(..

    - Prilep :D
     
    prilep, Jan 24, 2007 IP
  13. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #33
    probably cause your query needs to be something like:
    
    $query = "SELECT * FROM news_posts ORDER BY date DESC LIMIT 2";
    
    Code (markup):
     
    maiahost, Jan 24, 2007 IP
    prilep likes this.
  14. prilep

    prilep Well-Known Member

    Messages:
    3,852
    Likes Received:
    228
    Best Answers:
    0
    Trophy Points:
    185
    #34
    Too bad it still dosent work for me. O well i guess thats that. I will give you green rep for coming close to fixing it. Thanks anyways. Ill try to find a different one with better code.

    - Prilep :)
     
    prilep, Jan 24, 2007 IP
  15. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #35
    Keep the green until it's fixed. If you can give me temp access to the code and the DB I am sure I will be able to do something about it :)
     
    maiahost, Jan 24, 2007 IP
  16. prilep

    prilep Well-Known Member

    Messages:
    3,852
    Likes Received:
    228
    Best Answers:
    0
    Trophy Points:
    185
    #36
    i dont think you can but you can try. Do you have aim or msn??

    - Prilep :)
     
    prilep, Jan 24, 2007 IP
  17. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #37
    OK an update - all fixed :)
     
    maiahost, Jan 24, 2007 IP
  18. prilep

    prilep Well-Known Member

    Messages:
    3,852
    Likes Received:
    228
    Best Answers:
    0
    Trophy Points:
    185
    #38
    Yes all have been fixed! Thanks alot mate.

    - Prilep :D
     
    prilep, Jan 24, 2007 IP
  19. chopsticks

    chopsticks Active Member

    Messages:
    565
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    60
    #39
    Thats nice. :)

    So what was the actual problem with it?
     
    chopsticks, Jan 24, 2007 IP
  20. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #40
    Well it wasn't mysql related but the way the image was displayed - it actually broke the html and didn't show the image.
     
    maiahost, Jan 25, 2007 IP