Jump to content

RRO

New Members
  • Posts

    6
  • Joined

  • Last visited

RRO's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Also tried: $data/kendisplay/data/SText[@id="ken1"]/text=$_POST['ken1']; Here I get a syntax error.
  2. I tried your suggestion but got a syntax error: And have searched for php xpath xml but don't know what to use.
  3. Thanks for your reply. However, I'm not getting this implemented properly yet. How can I best include this in my code?
  4. Hello, I’m trying to change an XML file by PHP. It’s working but I can’t find how I can select the specific ID. any ideas? For example, I would like to change the text of <data> <SText id="p1"> Thanks in advance! PHP: <form method="post"> <input name="ken1" id="ken1" type="text"> <br> <input type="submit" name="submit" value="submit"> </form> <?php if(isset($_POST['submit'])) { $data=simplexml_load_file('display.xml'); $data->data->SText->ken1->text=$_POST['ken1']; $handle=fopen("display.xml","wb"); fwrite($handle,$data->asXML()); fclose($handle); } $data=simplexml_load_file('display.xml'); ?> XML file: <kendisplay> <meta> <request>setData</request> <version>1</version> </meta> <data> <SText id="p1"> <text>test</text> </SText> <SText id="p2"> <text>test</text> </SText> <SText id="ken1"> <text>test</text> </SText> <SText id="wait"> <text>test</text> </SText> </data> </kedisplay>
  5. used the error report function. (I didn't know) error: Column count doesn't match value count at row 1. made the table structures the same and now it works!! Thanks for the reactions!!
  6. Hi there, I'm trying to move a mysql item from one to another db tabel. It worked but after I worked further it stopt working... The delete part works. (Its my first php project) Did I make some mistakes in the code below? if ($_POST['mode'] === 'GO') { mysqli_query($conn, "INSERT INTO a SELECT * FROM b WHERE id='" . $_POST["id"] . "'"); mysqli_query($conn, "DELETE FROM b WHERE id='" . $_POST["id"] . "'"); echo json_encode(true); }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.