mysql

MySQL SSL connection through ADODB library

I have a MySQL database hosted on a remote server and it is enabled to accept only SSL connection. When I connect to this database using Java JDBC with SSL options, it works fine. There is a special jdbc string that I use for JDBC connection as below "jdbc:mysql://:/?verifyServerCertificate=false&useSSL=true&requireSSL=true" I need to u...

will a CURRENT_TIMESTAMP field will update automagically if you run an UPDATE statement against other fields in the table?

Will the CURRENT_TIMESTAMP column be updated even if I UPDATE some other column in the row? ...

Looking for a simple mySQLi class example with descriptions

Hi, I am looking for an example of a simple, but functional example of a class extending the mySQLi class in PHP5. I am interested in stored procedures also. Basically what I need is an example of a practical and usable class. I learn best by example and unfortunately I have been unable to find any site or book that seems to have a reall...

mysql_errno and mysql_error always reporting something

Hi, I have a query written as mysql_query($query,$conn) or die( "A MySQL error has occurred.<br />Your Query: " . $query . "<br /> Error: (" . mysql_errno() . ") " . mysql_error()); echo "You have been entered into our Database!"; This outputs A MySQL error has occurred. Your Query: INSERT INTO users (uid, twna...

Entity-Framework -> MySql gives 'Function evaluation timed out.'

I having a weird problem with Entity Framework with MySql database. Here's the code that I've got. public class testbase { private testEntities db = new testEntities(); public IQueryable<post> GetRecords() { return db.record; } } Here record is a table in my database and this could should return all the rows ...

MySQL Help

I need to run a query, and Im not sure if it's possible. I could do 2 queries but one is better right :| I have two tables. First is user, this consists of username and userid. The second is search which consists of userid and query. When I select the search table I want user ID to be replaced by username by taking the data from the use...

MySQL db problem in Python...

Hi, For me mysql db has been successfully instaled in my system.I verified through the following code that it is successfully installed without any errors. C:\Python26>python Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >...

Is it possible to use both order by and where in a single query

Hi friends, I have created a table. In one field, I have a priority of that record (between 1-9). I didn't set priority for all the records, so for some records, it will remain null. When displaying these records in my HTML page, I just check those priorities -- if the priority exists, then I will display as it is, if it's null, then...

MYSQL Stored Procedures If statement Problem

I'm working with Mysql 5.1.28-rc on freebsd. I've just decided to use stored procedures in MYSQL and created a test procedure as below: DELIMITER $$ DROP PROCEDURE IF EXISTS test $$ CREATE PROCEDURE test( IN test VARCHAR(22) ) BEGIN DECLARE count INT(11); SET count = (SELECT COUNT(*) FROM Test WHERE test_column = test ); SELECT coun...

Problem executing with Python+MySQL

Hi, I am not getting the reason why my python script is not working though I hv put all the things correctly as my knowledge.The below test I did and it worked fine.But when I import the MySQLdb in my script it gives error as no module name MySQLdb. **C:\Python26>python Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 3...

mysql query question.

Hello I have a table with articles and the articles have a column category. The categories are filled like 1,4,6,8 How can i check if there is a product which has in it for example category 5 I tried something like select * from article where category in(5); But that doesn't work. If I use like than i will have a problem with for e...

MYSQL: How can I create a MySQL table so, that a field's default value is the output of a function.

QUESTION How can I create a MySQL table so, that a field's default value is the output of a function. Can it be done without an insert trigger? BACKGROUND: Some entities and the groups they belong to need to be observed on a daily basis. To do that I created the following MySQL table: CREATE TABLE entity ( entity_id VARCHAR(1...

How to force MySQL to take 0 as a valid auto-increment value

Long story short, I have a SQL file that I want to import as a skel style file, so this will be done repeatedly, programmatically. I can edit the SQL file however I want, but I'd rather not touch the application itself. This application uses userid = 0 to represent the anonymous user. It also has a relevant (blank) entry in the database...

Optimizing my mysql query to use index for sorting

I have a composite index based on 3 columns, two of which are constrained in my query and the 3rd is in order by clause yet mysql doesn't use index for sorting. explain select * from videos where public_private='public' and approved='yes' order by number_of_views desc; +----+-------------+--------+------+------------------------------...

supported MySQL for Python2.6.1

Can any one tell me which MySQL version is suitable for Python2.6.1 to connect MySQLdb, I am using MySQL4.0.23 and MySQLdb of MySQL-python-1.2.3c1.win32-py2.6 after successfully installation also its showing No module named MySQLdb and I sent the Environment Variables also properly for Python2.6, using Windows XP, tested import MySQLdb...

planning for oracle takeover of sun - farewell mysql?

Now that the shareholders have voted and oracle will be taking over SUNW, does anyone have any facts about the implication for mysql users? If you don't have facts, I suppose conjecture would be interesting as well (but please label it so). I was afraid of what would happen when the original mysql team sold out to SUN (I don't blame th...

Setting subscription dates in MySQL

I'm dealing with a website where people can subscribe to certain things for virtual money. I need to put the dates at which subscriptions end in the database. My table has a field "expiration" for that, which is a DATE. When the user extends his subscription, I need to add 1 month to this date. However, if the subscription has already e...

mysql record not exceeding 16,384

I have two tables that i am inserting records into. I am using PHP to execute the sql query to perform the operation. When performing the insert operation, i insert 10,000 new records in two tables. One table completes insert process successfully on all operations while the second table completes the first insert operation but stops the ...

Is it better to use php sessions with objects or access db?

I'm at a crossroads, not exactly sure what is better to use. Right now I'm using sessions arrays to store calculations on the fly, but I need to switch to objects because I would like have some functions. But I was also considering using ajax and insert the data on the fly back and forth to the database but I'm worried it might be to man...

Subsonic Transaction Error

Considering the following code: List<Processo> listaProcesso = new List<Processo>(); Processo processo; processo = new Processo(); processo.AgendamentoID = 9; processo.DataEntrada = DateTime.Now; processo.EtapaExecucao = 0; processo.RegistrosAfetados = 2; listaProcesso.Ad...