@ismael ahm@d ... You can't echo out a <field> tags. Who taught you how to echo out a <field> tags? It's like say you echo out a <html> tag. You can only echo out the name of the variable. Do you understand now. I assume you can get these from the database: ... Since the issue is not the database then it's the <field> tags. Try to used <input> tags Instead of this: ... Try…
Post Contains: Links Quotes Code
@ismael ahm@d ... If you still want to used <field> tags. Then read the link: ... It's the correct way of using it. or you can used <input> tags
Post Contains: Links Quotes
@ismael ahm@d ... Did you read it correctly? You don't need to recode xml file? All you need to add is a ... . ... In order to input the data by using form , you need to used <input> tags not <field> tags.
Post Contains: Quotes Code
@ismael ahm@d In order to input the data in to the database by using form , you need to used <input> tags not <field> tags. Then you can used <field> tags to fetch the xml data. Does that make sense?
... This is input tags ... When you submit that form learningpermitno & applicantname will be in the database. On here it should look like this: ... Then on your <field> tags: ... You need a query to select those xml from your database. Does that make sense?
Post Contains: Quotes Code
i completed mostly but little bit left, issue in the <field></field> the data between that not inserted in db, please consider the below mentioned XML file...
the XML file which i am getting not formated or written by me, i got that file from other source, and now i am just want that insert given xml data into db, in which as you know that data between below <userinfo> tags inserted successfully
What values are you not getting? mysql_real_escape_string($oBookNode->getElementsByTagName('field')->item(0)->nodeValue), to get the value of the second 'field' tag change item to (1) mysql_real_escape_string($oBookNode->getElementsByTagName('field')->item(1)->nodeValue), ran on my machine: output =: sql = INSERT INTO timestamp_table (learningpermit, applicantname, penid, email, phone,firststroke) VALUES ('LOO4', 'Kaifi', 'AJX-AAQ-JFN-5Z', 'firstname.lastname@example.org', '123456', '1352793331')
I accept that i am not getting about xml and you doing best to sort out, but why you are not make it easy for me as you know that i am playing first time with xml, even i have sent you my all code in the begining of post.
Dear diafol, yours advice for item(o),(1) exactly right, even i have added some extra tages between <userinfo> example: <penid>AJX-AAQ</penid>, <penid>AJX-AAQ-JFN-5Z</penid> and changed its item value accordingly. but in the <field> still no luck even i have changed item values, even i put <fields> under <userinfo>.... please advice for better solution
I think you'll find ddymacek first spotted it. I can't see why your <field> value won't work. Try running the code I supplied to see if it echoes out the field data. Or alternatively, echo the SQL as ddymacek has done: