Hello, I have a parser on c # which writes articles to the database.
private void insertData() { string conStr = "server=127.0.0.1;user=skr1pt1k;" + "database=study;password=11101110aA;"; using (MySqlConnection con = new MySqlConnection(conStr)) { try { string a = File.ReadAllText(@"title.txt", Encoding.Default); string b = File.ReadAllText(@"text_out.txt", Encoding.Default); string c = File.ReadAllText(@"asdd.txt", Encoding.Default); string sql = "INSERT INTO text (Title, Text, Tags) VALUES ('" + a + "', '" + b + "', '" + c + "')"; MySqlCommand cmd = new MySqlCommand(sql, con); con.Open(); cmd.ExecuteNonQuery(); } catch (Exception ex) { SystemSounds.Beep.Play(); MessageBox.Show(ex.Message); } } } Sometimes, when a page parsit error pops up, you get an error in your sql syntax
Here is a photo database (structure) http://c2n.me/3CA7PMx . What could be wrong? Here is an example of one error. http://c2n.me/3CA7Uk6
string sql? And show on the website if a, b and c are not company secret. In general, use the query with the parameters and life will become easier. How much taldych about this, and noobs that the peas against the wall. - Sergey