mysql

Query direction issue

Hi, I am stuck at the start of a small project and I am not sure what would be the best way to go with a query etc. The story is that I have a table with members predictions on a particular sport. They have predicted the top 5 places of each event (about 19 events in total). Some of these predictions have been entered more than once as...

mysql query only returning a single row

the following mysql query is only returning a single row when it should be returning 4. $query = "SELECT * FROM questions"; $result = mysql_query($query) or die("ERROR: $query.".mysql_error()); // if records are present if (mysql_num_rows($result) > 0) { while ( $row = mysql_fetch_object($result) ){ // get question ...

Extract mail from Exchange and load into Mysql. Perl Win32::OLE or Perl Net::POP3, or try it in Ruby, or dabble in the, bletch, MS Access dark arts?

My problem is this: I need determine the timestamp of the first and last email sent from an Exchange account for every day that mail exists for. Also, for each day I need to rank the words that appear in each email so that I can report trend words for each day. I have two approaches to this I'm considering, and would welcome comments an...

SubSonic: MaxLength of TableColumn (exceeding)

Hey all! So, we're using SubSonic as our DAL/ORM for one of our projects. Everything has been running smoothly (the database already existed, so we used SubSonic on top of it), however, on occasion we'll run into an exception that says something like the integer is exceeding the max length. In this example, our MySql field is an int(4) ...

PHP Insert into database not working

Greetings I made the following php script so that I could edit text and it would save to a db for future use. However I'm hitting a slight snag at the update / insert queries. I'm not sure what I'm doing wrong but only one of the commands will execute. I'm not sure if this is a hosting issue or am I doing something wrong. Any ideas? ...

Tricky SQL SELECT problem (MySQL)

Having this table (sorry, cant seem to get a decent layout here): PD Header Text Mask_Producer Mask_Dep Mask_Diam ---------------------------------------------------------------------------------------------- 10 Producer Aproducer Aprod * * 10 Produ...

Mysql subquery fails, need help :)

I have a table PICTURES: username varchar(50) picture_id varchar(50) datetime ...and I have a table FRIENDS: user_1 varchar(50) user_2 varchar(50) datetime When you have friends on the website your username goes in user_1, and your friend username's go in user_2. For each new friend a new row... I want to show the 5 last ...

Hibernate MySQL transaction configuration issue

I'm having trouble starting a transaction with Hibernate and MySQL while running in JUnit. I'm getting a HibernateException which states: "No TransactionManagerLookup specified". I believe this error is because I don't have a proper configuration setting for hibernate.transaction.manager_lookup_class. I see that under the namespace of ...

Get MYSQL Data Into AJAX

I'm an AJAX novice and I'm having major trouble trying to get data out of mySQL and into my javascript function. What I want to do is loop through my data in php and somehow send that data into various named divs on the page. Here's the code from my javascript page: function loadPageContent(){ var projectID = getQuerystring('pid'); ...

Script to Add User to Wordpress

Hi, I need help to quickly add about >100 username and password to a locally installed Wordpress. I have a list of usernames in text file, and I'd let each password to be equal to username (or someother function if equal is not allowed by Wordpress). Is there a way I can programmatically add users to Wordpress? I have access to wordp...

How to switch from SQL Server to MySQL for using with Excel pivot

I have a table that contains sales transaction (~20 mil rows). Previously I used SQL Server and export it to an Excel pivot. Data refresh took 10-15 minutes but still do-able. However, after I migrated to MySQL (using XamppLite & ODBC), it took forever to refresh the data in the Excel pivot. Maybe I didn't optimize the MySQL good enough...

Does jheidisql alpha 4r2 support Stored Procedure

i created a stored procedure using Heidisql 4.0 in Windows system. Now server system has been changed to linux. So i installed jheidisql alpha 4r2. I cant create stored procedure in it. Is there any other way to create stored procedure in linux environment for Mysql Is there any stable version for Linux. Plz help me. Thanks in-advance. ...

MySQL conditional UPDATE using IN

I have a database table with a column named featured which is used to highlight featured content on a page. Currently, I'm using two SQL statements to toggle the featured rows on/off like so: -- Reset everything to non-featured UPDATE tbl SET featured = '0'; -- Now set the selected rows as featured. UPDATE tbl SET featured = '1' WHERE...

Need sample Stored Procedure for Mysql5.0 in Linux

Can any one post me Stored Procedure for Mysql5.0 in Linux environment. I have create Stored Procedure but it show Exception as Syntax error check for Version. My need is i want to take sum value from on table and convert it into String and Inserted into another table with date and time. This is my procedure; Can any one correct it fo...

ASP.Net Providers for MySQL

Hello. Are there ASP.NET 2.0 Providers available for MySQL? On Googling, I find discrete (and incomplete) pieces of code on codeplex and elsewhere. Alternatively there is dotConnect from Devart, however, it is commercial. I am looking for something that is open source, free & production quality. The one that I am looking for should...

MySQL - Find MIN but not zero

Dear people, I am trying to fetch the minimum value of a column in MySQL using the MIN function. But is it possible to tell MySQL to ignore the zero values? Problem is that I am storing 0 as default value instead of NULL for a tinyint column. What I want is to get the minimum value that is greater than 0. SELECT a.baseloc_id, a.baselo...

What is the default setting for innodb_data_file_path if it isn't specified in my.cnf?

What is the default setting for innodb_data_file_path if it isn't specified in my.cnf? When I try to execute the following command on a 12GB table full of pictures alter table `rails_production`.`pictures` change `data` `image_file_data` mediumblob NULL; I get the following error ERROR 1114 (HY000): The table '#sql-7fe4_12c9' is ful...

Mysql timeout problem

I have got the error "Lock wait timeout exceeded; try restarting transaction".What are the reason for this and how to solve the problem?FYI: innodb_lock_wait_timeout = 100 in Mysql config file. ...

How do I order by multiple columns in a SELECT query?

I have a table of records like below int_record_id int_category_id str_name int_order bit_active 1 1 test1 2 1 2 1 test2 1 1 3 2 test3 1 1 1 3 te...

Can this MySQL db be improved or is it good as it is?

In a classifieds website, you have several categories (cars, mc, houses etc). For every category chosen, a hidden div becomes visible and shows additional options the user may specify if he/she wishes. I am creating a db now, and I have read some articles about normalization and making it optimized etc... Here is my layup today CATEGO...