How can I change the MySQL query delimiter using the C API? I tried sending DELIMITER | as a query, complained about ..the right syntax to use near 'delimiter' at line ... |
I've written a C program thats running multiple threads and uses MySQL. After some testing i repeatedly saw the error (with hours between) "Mysql server gone away", so i maximized the ... |
If I have code like this (irrelevant things like initialising the connection and handle omitted):
MYSQL_RES *res;
MYSQL_ROW row;
mysql_query(mysql, "some select query");
res = mysql_use_result(mysql);
while (row = mysql_fetch_row(res)) {
MYSQL_RES *res2;
...
|
folks,
from the following code
int a = mysql_query(conn,"INSERT into data VALUES (NULL,'tes','aja'));
how come i could make sure mysql_query is do the supposed thing, because i've tried wrong sql query and it ... |
I'm writing a c program with an mysql database connection
and I'm having difficulties creating my mysql queries...
i want to you a variable integer in my mysql query, but i can't seem ... |
Is there a more concise way to write the following query (using Mysql + C ):
memset(query, 0, 200);
strcat(query, ...
|
I use this code in order to print a result set, but it actually does nothing...
it doesn't print anything..what's wrong with that?
Thanks in advance..Vera
char query[512];
sprintf(query, "SELECT * ...
|
|
Did you ever print out query after the sprintf() statement to see what the string looked like after you stuck it in there? Also, what error are you getting? I get a segmentation fault then the program aborts. only when i add the \" or '. I did print out the string query and it contains the correct data which is: ... |
Please allow me to preface this post with an apology. I'm not sure where the below issue is derived from, (the difference in operating systems, a MySQL problem, a C problem, etc...), so if this post is in the wrong topic, again, my apologies. ...continuing on... System Setup 1: Microsoft Windows XP Professional, SP3, 32 bit. MySQL 5.1.47 System Setup 2: ... |
public int getCount() { DataTable data = null; MySqlDataAdapter da; MySqlCommandBuilder cb; int total = 0; try { if (getConnection(dbName, dbHost, username, password)) { string query = "SELECT count(*) as total from tableA WHERE status > 1"; data = new DataTable(); da = new MySqlDataAdapter(query, conn); cb = new MySqlCommandBuilder(da); da.Fill(data); DataRow row = data.Rows[0]; total = (int)row.ItemArray.GetValue(0); //THIS LINE THROWS ... |
1. I have never integrated MySQL with C/C++, and whole SetDlgItemText() function is unknown for me... But I guess it would help us if you showed where you dumb the data in row[0] (I assume that's pointer to char array, right?). Perhaps you have some problem in there? Try couting/printing the contents of row[0] before using the function to see if ... |
|
|
Ah, wait no, that won't work. Let me think again. I think the solution invloves joining the table to itself so that you then have a super table that has a combination of every row with every other row so that you can find A and C. But I'm not sure how to do it. |
Hi I want to do something like the following: SELECT * FROM table WHERE townname LIKE 'A%' AND townname LIKE 'B%' AND townname LIKE 'C%' ORDER BY townname but this doesn't seem to work, what am I doing wrong? Or is there an easier way to do this as I will need to also create the selection for the letters D ... |
|
4 October 2011 - In light of a recent security incident, customers are advised to update their antivirus definitions and run a full antivirus scan on all computers that accessed the MySQL site between September 20th, 2011 and September 28th, 2011. Also, out of an abundance of caution, we advise MySQL account holders to then change their MySQL account passwords. |
4 October 2011 - In light of a recent security incident, customers are advised to update their antivirus definitions and run a full antivirus scan on all computers that accessed the MySQL site between September 20th, 2011 and September 28th, 2011. Also, out of an abundance of caution, we advise MySQL account holders to then change their MySQL account passwords. |
4 October 2011 - In light of a recent security incident, customers are advised to update their antivirus definitions and run a full antivirus scan on all computers that accessed the MySQL site between September 20th, 2011 and September 28th, 2011. Also, out of an abundance of caution, we advise MySQL account holders to then change their MySQL account passwords. |