I am torn between postgreSQL and MySQL but I am forced to install the choosen one on windows. I especially need asp.net membership and i will be installing NHibernate as well.
I'm running program at apache tomcat server, that should be on permanently, but every morning(the client part isn't accessible at night) i receive error message (in apache tomcat console) that MySQL server is off. So is there any way to prevent this?
Thanks in advance!
i need to connect mysql server from other new server, the IP address of the new server is in UK. please reply me is there any possibility to connect the new one?
I have a mysql query where a subquery is:
BETWEEN '5.00' AND '10.00'
And this returns no results.
However when I use Floats or Ints:
BETWEEN 5 and 10
it works
The BETWEEN query also works for other values AS strings, but just not for 5 and 10.
EG:
BETWEEN '4' AND '5'
works.
How could this be?
Hi,
here is the "msg" table on mysql
sent_to customer msg read
------- -------- ------ -----
45 3 bla 0
34 4 bla 1
34 6 bla 0
45 3 bla 0
56 7 bla 1
45 8 bla 0
for example user whose id number is 45 logs in,
i want him to see this,
you have 2 unread msg to your "number 3" customer
you have 1 unread msg to your "number 8" customer
like a news feed
what query should i use for this ?
thx
I am building a PHP and MySQL search as so
SELECT * FROM Properties WHERE Locaion = 'Liverpool'
I want to count how many of each property type there are and display them at the side of the page to use as filters (like Rightmove.co.uk).
This is what I am have come up with but can't get it to work
SELECT *,
count(PropertyType = 'house') AS HouesTotal,
count(PropertyType = 'Apartment') AS ApartmentTotal
FROM Properties WHERE Location = 'Liverpool'
Can anyone help?
How to connect to MYSQL DB from Java, create table, insert data, retrieve it with datatypes.
How to make use of the data to/from in Flex application.
plz help me out..
i have basic knowledge in sending and receiving messages using BlazeDS.
and calling JAVA METHODS USING ...
My current process for debugging stored procedures is very simple. I create a table called "debug" where I insert variable values from the stored procedure as it runs. This allows me to see the value of any variable at a given point in the script, but is this is there a better way to debug MySQL stored procedures?
I'm working with python and mysql and I want to verify that a certain entry is compressed in the db. Ie:
cur = db.getCursor()
cur.execute('''select compressed_column from table where id=12345''')
res = cur.fetchall()
at this point I would like to verify that the entry is compressed (ie in order to work with the data you would have to use select uncompress(compressed_column)..). Ideas?
I am using mysql and there are bulk inserts that goes on to my table.
My doubt is if I create a trigger specifying after insert, then the trigger will get activated for every insert after, which I do not want to happen.
Is there any way to activate a trigger after all the bulk inserts are completed?
Any advice?
Thanks.
Is it possible to assign php array in MySQL IN() function? for example,
$numbers = array('8001254656','8886953265','88864357445','80021536245');
$sql = mysql_query("SELECT * FROM `number_table` WHERE `number` IN ($numbers)");
Any Ideas?
Thanks,
I had the below query working in mysql 4.1, but does not in 5.0:
SELECT * FROM email e, event_email ee
LEFT JOIN member m on m.email=e.email
WHERE ee.email_id = e.email_id
The error:
1054 (Unknown column 'e.email' in 'on clause')
So,
I can run the following statements from within mysql itself successfully.
SET @fname = 'point1';
SELECT * FROM country WHERE name=@fname;`
But when I try to pass the query through php like this and run it, I get an error on the second line
$query = "SET @fname = 'point1';";
$query .= "SELECT * FROM country WHERE name=@fname;";
is there a way to have a mysql select statement return fully qualified column names like "table.field" without using AS for every single field?
like so:
SELECT *
FROM table1
LEFT JOIN table2 on table1.f_ID = table2.ID
and the result would be:
"table1.ID", "table1.name", "table2.ID", "table2.name", ...
I have this mysql table called comments which looks like this:
commentID parentID type userID date comment
The commentID is set as Primary key, but most of the time I fetch the data using the parentID. How should I set my indexes?
Should I just add an index on parentID and let commentID be the primary key?
When i run a mysql select statement, it takes very long because i have already previously deleted a very large number of rows.
Is there a way for the table to start scanning from the bottom, as opposed to from the top?
In one of my forms I use the rich text editor from Yahoo!.
Now i want to store the data from that textarea in a MySQL database.
The user can enter anything in that textarea, e.g. many double or single quotes.
How can I store that data?
Normally we store by adding that data in one variable and then put that in sql, but the quotes cause problems.
This is the best way I could come up with to convert a MySQL GUID/UUID generated by UUID() to a binary(16):
UNHEX(REPLACE(UUID(),'-',''))
And then storing it in a BINARY(16)
Are there any implications of doing it this way that I should know of?
All,
I have a database table in mysql with a field that is of "TIMESTAMP" type. I need help writing the SQL query to update the field with the current timestamp.
UPDATE tb_Test set dt_modified = ?????
Thanks,
I have "tasks" table with 3 fields:
date
priority (0,1,2)
done (0,1)
What I am trying to achieve is with the whole table sorted by done flag, tasks that are not done should be sorted by priority, while tasks that are done should be sorted by date:
Select * from tasks order by done asc
If done=0 additionally order by priority desc
If done=1 additionally order by date desc
Is it possible to do this in MySQL without unions?
Thanks.
Hi,
can a MySQL slave instance have different row values for the same ID when binlog_format is set to STATEMENT and we insert something like:
insert into foo values(CURRENT_TIMESTAMP)
As I understand it, the slave read the SQL statement and execute it thus, if the replication is lagging, could lead to differences for the same row. Right or wrong ?
How can I avoid this situation ?
Thank you.
Hello,
I need to update a column in a mysql table.
If I do it in two steps as below, is the column "col" updated twice in the disk ?
update table SET col=3*col, col=col+2;
or is it written only once as in :
update table SET col=3*col+2;
Thanks