开发者

What am i doing wrong? create xml using php

开发者 https://www.devze.com 2023-04-07 12:00 出处:网络
I am following this tutorial step by step http://code.google.com/apis/maps/articles/phpsqlajax.html . Actually I copy pasted the code and created the database,开发者_开发知识库 added the data to the t

I am following this tutorial step by step http://code.google.com/apis/maps/articles/phpsqlajax.html . Actually I copy pasted the code and created the database,开发者_开发知识库 added the data to the table, downloaded the provided php and html files but when i actually try to run the page that will create the xml file i get this error. Can anyone guess what is wrong? I am using XAMPP 1.7.4 [PHP: 5.3.5]

(The google tutorial suggests 3 ways to generate the xml file. I tried all 3 of them and the same error appears on the first 2 and an "error on line 10" (which is the line that php script begins) appears when i try the 3rd suggested way. I am thinking if this wont work to use mysqldump command in order to export the xml file i need.)

What am i doing wrong? create xml using php

What am i doing wrong? create xml using php


You have two root elements in your XHTML: html and markers. This is why your browser correctly considers it to be invalid.

The problem with blindly copying/pasting code is that when you come across a problem it's very difficult to solve, because you don't understand what the code is doing. I suggest you read through the code closely. When you understand it, you'll be able to fix it.

Essentially you'll want to remove all of the output up until the <markers> tag. Perhaps the HTML file you're using is incorrect.


-EDIT-
Problem was in the connection to the database, value for $host and/or $user and/or $pass was incorrect or not provided.


If you use version 2 (phpsqlajax_genxml2), edit the file at line 15 replacing localhost with 'localhost'.

If you use version 3 (phpsqlajax_genxml3), edit the file at line 13replacing localhost with 'localhost'.

Then try again.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号