Click here to Skip to main content
15,883,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My xml is formatted is as given below:

XML
<course>
   <login>1</login>
   <version>1.2.3.5</version>
   <course_id>1</course_id>
   <course_name>physics</course_name>
   <module module_id="1">
          <page>1</page>
   </module>
   <module module_id="2">
          <page>12</page>
   </module>
   <module module_id="3">
          <page>4</page>
   </module>
</course>


Here is what I want:

if (a module node with module_id value 2 not exists than)

{
my code

}

how to find this node...

i was trying this ..

$value=$row['Module_id'];

$ModuleValue=$xml->$xpath("/Course/Module[Module_id]='$value'");
if($ModuleValue==null)

{


}
Posted
Updated 12-Dec-13 23:18pm
v4
Comments
CHill60 13-Dec-13 4:59am    
Retag your question - this is XML not MySQL

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900