Updating xml with php

I want to update the node values but the above code seems to be incorrect. UPDATE: My question is somewhat similar to this Updating a XML file using PHP but here, I'm loading the XML from an external file and also I'm updating an element, not an attribute. Also, as Ward Muylaert pointed out, you need to save the file. Here's a great tip: always name the variable that holds your XML document after its root node, it will prevent such confusion.For example, you can remove or delete a node or element.You can clear it so that its blank, but you can't eliminate it altogether. $id=$_GET['id']; $username="username"; $password="password"; $database="your_database"; mysql_connect(localhost,$username,$password); $query=" SELECT * FROM contacts WHERE id='$id'"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i As you can see, this code will output a standard form, but instead of having blank boxes like on the form for inserting a new record, this one already has the current information from the database inserted into it.This makes it much more effective for an update script. Would be nice to resolve this problem in higher versions!!So far you have learnt how to put information into your My SQL database, view the information in it and select which information you would like to view.

An new release of the package is available which fixes this issue.This can be done using the set Attribute() method or setting the node Value property of the attribute node.Keep in mind that although you can edit XML with Simple XML, there are limitations.The purpose of Stack Overflow, in my opinion, is to help users by giving them examples that may help them in resolving their issue.Not to imply that they haven't read or searched in the documentation.

Leave a Reply