Advertisement
Toni11

Untitled

May 18th, 2016
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1.  
  2. mysql_connect($sdd_db_host,$sdd_db_user,$sdd_db_pass) or die(mysql_error());
  3. mysql_select_db($sdd_db_name) or die(mysql_error());
  4. echo "posle soska";
  5.  
  6. $xmlURL = "1.xml";
  7.  
  8. $sxml = simplexml_load_file($xmlURL);
  9. var_dump($xml->children());
  10.  
  11. echo "what is it";
  12.  
  13.  
  14.  
  15. //foreach($sxml-> goods as $good){
  16. foreach($sxml->children()as $good){
  17. echo "after cicle";
  18. $sh = stripslashes($good->attributes()['sh']);
  19. $name = stripslashes($good->attributes()['name']);
  20. $ed = stripslashes($good->attributes()['ed']);
  21. $cost = stripslashes($good->attributes()['cost']);
  22.  
  23. var_dump ($goods);
  24.  
  25.  
  26.  
  27. $sql = ("INSERT INTO Place (sh,name, ed, cost) VALUES('$sh','$name', '$ed', '$cost')");
  28.  
  29. result = mysql_query($sql) or die("Error ".mysql_error());
  30.  
  31. }
  32.  
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement