keeping busy

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

keeping busy

Post by ol4pr0 »

keeping busy on the XML thing...

and keep on getting stuck nomather in what way i am using the output.

now somewhere on this forum i got this reply.

using this ;

Code: Select all

<?php 

$link = mysql_connect("localhost", "root"); 
$db = mysql_select_db("aduana"); // db 

$output = ''; // make output var 

$query = "SELECT $value1, $value2, value3 FROM $tabla ORDER BY $id? LIMIT 5";  
$result = mysql_query($query, $link); 

while($rows = mysql_fetch_array($result)) {  
 
$output .= <<< XML 

<person> 
   <name>{$rows['name']}</name> 
   <gender>{$rows['gender']}</gender> 
   <age>{$rows['age']}</age> 
<person> 

XML; 

} 

header("Content-Type: text/xml"); 

echo <<< OUT 
?>
the problem or error which is being returned =

Parse error: parse error, unexpected T_SL

cuased by $output .= <<< xml

i am getting very desperate here.. and need to get it to work lol...
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

try to remove the space between the '<<<' and 'XML'
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

<<<

Post by ol4pr0 »

i whished that would do the trick..


mainly what i am trying to do is to have something from the databaes being translated to a xml document or format..

and since i am not very familiar with xml-rpc.. or whatever i am bound to do it like this i am afraid untill i do know how to get my pear soap installed and learning rapidly about xml-rpc
thank for trying but the space didnt make a differance
Post Reply