Jump to content
php.lv forumi

XML problēma


NBS

Recommended Posts

Sveiki, cenšos cikliski izvilkt XML no sava DB.

 

Cikls:

 

for ($n=0; $n<$rows; $n++) {

echo "<item>\n<name>" . $row->product_name . "</name>\n" . 
	 "<link>" . "http://localhost/index.php?page=shop.product_details&category_id=$row->category_id&flypage=shop.flypage&product_id=$row->product_id&option=com_virtuemart&Itemid=12" . "</link>\n" .
	 "<price>" . $row->product_price . "</price>\n" . 
	 "<image>" . "http://localhost/components/com_virtuemart/shop_image/product/". $row->product_thumb_image . "</image>\n" . 
	 "<category>" . $row->category_name . "</category>\n" .
	 "<category_full>" . $row->category_name ." > ". $row->product_name . "</category_full>\n" .
	 "<category_link>http://localhost/index.php?page=shop.product_details&category_id=$row->category_id&flypage=shop.flypage&product_id=$row->product_id&option=com_virtuemart&Itemid=12</category_link>\n" .
	 "<in_stock></in_stock>\n" .
	 "</item>\n";
$row=mysql_fetch_object($sql_result);
}

 

Kļūda:

 

[31-Oct-2008 13:32:04] PHP Parse error:  syntax error, unexpected T_VARIABLE in index.php on line 40
[31-Oct-2008 13:46:56] PHP Parse error:  syntax error, unexpected T_ECHO, expecting ',' or ';' in index.php on line 35
[31-Oct-2008 13:49:19] PHP Parse error:  syntax error, unexpected T_STRING in index.php on line 1

 

Pilnais kods: http://paste.php.lv/8251?lang=php

 

Vēlējos uzzināt arī Jūsu viedokli par XML vai šādā veidā ir vispār efektīvi iegūt datus un izveidot XML failu, jo saskaros ar xml pirmo reizi.

Liels paldies, savlaicīgi.

Link to comment
Share on other sites

×
×
  • Create New...