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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    noob question. writing xml from mysql

    Hello and thanks in advance for any help you can give.
    Im trying to populate an xml file with data from a mysql db. I keep getting a parse error and I am too inexperienced to know what I have done wrong.

    while($row=mysql_fetch_array($result)){
    $line = '<_ path='".$row[path]."' rate='".$row[_path]."' title='".$row[title]."' artist='".$row[artist]."'/>';
    echo $line

    The red line is the one throwing the parse error.

    My browser shows this error:
    Parse error: syntax error, unexpected '<' in C:\host\xampp\htdocs\v2\playlist\generator.php on line 12

    The code I am using is from a tutorial, but I do not know how accurate it is.

    Thanks!

  • #2
    Regular Coder goughy000's Avatar
    Join Date
    Nov 2005
    Location
    England
    Posts
    415
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'v never seen the need for joining variables like that, I jus throw them all in at once.

    PHP Code:
    $line "<_ path=\"$row[path]\" rate=\"$row[_path]\" title=\"$row[title]\" artist=\"$row[artist]\" />"
    dno if thats what your looking for


  •  

    Posting Permissions

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