[Solved] Parse xml-file and insert into mysql database

The place of mysql_query isn`t correct. You must insert records in loop: foreach ($xml as $syn) { $w1 = $syn->w1; $w2 = $syn->w2; $sql = “INSERT INTO db_name (w1, w2) VALUES (‘$w1′,’$w2’)”; $query = mysql_query($sql); if (!$query) { echo (‘Error: ‘ . mysql_error()); } else { echo “Record added”; } } mysql_close($con); 3 solved Parse … Read more

[Solved] No curly braces if else statements?

It will print out 5. It doesn’t even approach to the second if-else, because doesn’t pass the first condition x!=5 and the else statement is missing and it goes to the last line where you print the variable out. It’s the same as: int x=5, y=5, z=5; if (x!=5) { if (y<=7) { z=z+4; } … Read more

[Solved] How are going to read a text file and auto save in c # [closed]

read all text string fileText = File.ReadAllText(“filePath”); if (fileText.Contains(“apple”)) { Messagebox.Show(“This word is exist”); } else { Messagebox.Show(“The word does not exist!”); File.AppendAllText(@”filePAth”, “The word does not exixt in the text file” + Environment.NewLine); } 1 solved How are going to read a text file and auto save in c # [closed]

[Solved] Set a tr id in jQuery [closed]

http://api.jquery.com/html/ The html() function gets the html string. Then when you pass it in to $(), JQuery is creating html elements that are the same as your content and are not part of the DOM. Instead you should just use: $(‘#id’).prop(‘id’, ‘id’ + cnt); 0 solved Set a tr id in jQuery [closed]

[Solved] Extract the particular portion from a String

Here’s one way: public static void main(String[] args) { String s = “abc,xyz,lmn,ijk”; char[] ch = s.toCharArray(); int counter = 0; int place = 2; for (int i = 0; i < ch.length-2; i++) { if(ch[i] == ‘,’) { counter++; } if(counter == place && ch[i] != ‘,’) { System.out.print(ch[i]); } } } It prints … Read more

[Solved] Scala, Akka, Lagom, Play, Reactive and Microservices [closed]

The question is a bit too broad to answer it here. But Jonas Bonér, the creator of Akka, explores the relationship between Microservices and Reactive Systems in his free ebook “Reactive Microservices Architecture“, why don’t you read that for a start. Akka is a library/tookit, it’s more low-level and doesn’t guide you towards using certain … Read more

[Solved] strncmp don’t work as it should

strcmp & strncmp functions return 0 if strings are equal. You should do: if (strncmp(frase1, frase3, 4) == 0) … i.e.: char *str1 = “Example 1”; char *str2 = “Example 2”; char *str3 = “Some string”; char *str4 = “Example 1”; if (strncmp(str1, str2, 7) == 0) printf(“YES\n”); // “Example” <-> “Example” else printf(“NO\n”); if … Read more

[Solved] Redirect to URL with variable inside php

<?php if(isset($_POST[‘action’]) && $_POST[‘action’]!=””) { if(isset($_POST[‘username’]) && $_POST[‘username’]!=””) { header(‘Location: some_other_page.php?username=”.$_POST[“username’]); exit; } } ?> <form action=’index.php’ method=’post’> <input name=”username” type=”text” value=”” placeholder=”Insert username here”> <input type=”submit” value=”Go” name=”Go”> <input type=”hidden” name=”action” value=”do_redirect”> </form> 1 solved Redirect to URL with variable inside php

[Solved] C Program for reading test results [closed]

When using if statements and you want to compare a result you should use == instead of =. With = you are assigning a value to a variable and == compares between to values. You can also not compare two things at the same time like: if (result = 70<=100) You need to check if … Read more