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 3 of 3

Thread: Xml in php

  1. #1
    Regular Coder Andy92's Avatar
    Join Date
    Nov 2005
    Location
    Horsham, West Sussex, UK
    Posts
    363
    Thanks
    7
    Thanked 1 Time in 1 Post

    Xml in php

    Hi there,

    Is there any way to insert xml in php, and make xml titles variables?


  • #2
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts

  • #3
    Regular Coder Andy92's Avatar
    Join Date
    Nov 2005
    Location
    Horsham, West Sussex, UK
    Posts
    363
    Thanks
    7
    Thanked 1 Time in 1 Post
    Ok,

    Here is what i have...

    PHP Code:
    <?
    header
    ("Content-type: text/xml");
    echo 
    "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";

    mysql_connect("localhost""username""password") or die(mysql_error());
    mysql_select_db("database") or die(mysql_error());

    echo 
    '<rss version="2.0">';

    echo 
    '<channel>
    <title>Allsortgroup Blog</title>
    <description>The allsortgroup blog rss feed!</description>
    <link>http://www.allsortgroup.com/blog/group</link>'
    ;

    $data mysql_query("SELECT * FROM blog LIMIT 30");

    while(
    $row mysql_fetch_array($data)) {

    echo 
    '<item>
    <link>http://www.allsortgroup.com</link>
    <title>'
    .$row['title'].'</title>
    <description>'
    .$row['mini'].'</description>
    </item>'
    ;

    }

    echo 
    '</channel></rss>';
    ?>
    All is working fine at...

    http://www.allsortgroup.com/feed.php

    But, when i change the limit from 30 to say 50, the content goes black and only the title and description is there. Also, is does this also what i add in ORDER BY id DESC.

    Does anyone know why?


  •  

    Posting Permissions

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