mysql

Connecting to MYSQL from a c# application

Hi, the underlying database on a project has changed from sql 2005 to MySql 5.1 The code has loads of method similar to below. I'm presuming it is just a case of switching the 'con' variable SqlConnection to a MYSql specific connection. Has anyone had any experience with this? I have never touched a mySql db. Any help much appreciated. ...

MySqlcan't set a nullable column to null

Hi, I'm trying to insert a row into a table named Booklets which has a nullable column BookletSubjectID. The insert is failing because 'BookletSubjectID' cannot be null Here's my MySQL session copied verbatim. I must be missing something really obvious, but can't see it. mysql> desc Booklets; +----------------------+------------...

How to get from sub query where id does not exist

Hi, I have a sql query that is retrieving results from a table but I need it to only show results if the ids are not in another table. Example $sql = "SELECT id FROM TABLE_1 WHERE id NOT IN(SELECT more_id FROM TABLE_2) The idea is that if the id does not exist in the list of "more_id" then it should show the result. It does not s...

High Performance MySQL

A coworker handed me a copy of High Performance MySQL by Jeremy D. Zawodny and Derek J. Balling. The book (published by O'Reilly) has a publish date of 2004. I haven't found an updated edition. My question is how reliable is the information at this time? For example, the author's make the statement "MySQL will only ever use one index pe...

Problem sending emails to yahoo and hotmail users?

I am using php and mysql. Each time an user register on my website, I will use php mail() to send a single email for authentication. Recently I found out that, a lot of yahoo and hotmail users are not activated their accounts, lets say upon 1000 users, only 200 are activated. I am curious, and I try register using my hotmail account....

Help on an (another) SQL query

Following my previous question. I have a table named activity with 2 columns: `when` as datetime // last time i saw a user guid as varchar // a unique identifier for each user I have a query that returns how many new users I have for a given date and timespan: SET @till_date='2009-11-01'; #for today, give CURDATE()+1 SET @duratio...

Transfer table to Memcache

Hi, I have a large table and I'd like to store the results in Memcache. I have Memcache set up on my server but there doesn't seem to be any useful documentation (that I can find) on how to efficiently transfer large amounts of data. The only way that I currently can think of is to write a mysql query that grabs the key and value of th...

Migrating Wordpress from sub-domain to root.

Hi. I am about to start building a new site in Wordpress on the same domain as the old site. I need the old site to stay live until the new one is launched and I also need to develop online. What is the best way to go about this? Should I create a subdomain or subfolder? How would I go about migrating the Wordpress site & database fro...

Catching update errors on MySQLdb

I have a function that updates a MySQL table from a CSV file. The MySQL table contains the client account number -- this is what I use to compare with the CSV file. At some point, some of the queries will fail because the account number being compared from the CSV file has not been added yet. How do I get the records from the CSV file t...

CakePHP using multiple databases for models

Is it possible for certain models to be in one database and other models in another (using the same connection)? I have a number of read-only tables that I want shared between multiple installations of my system. Other tables need to be per-installation. For the sake of example, let's say users is the shared table, and posts is per-inst...

MYSQL - Cannot able to create table.

I am using MYSQL 5.1. When i am going create a table, it throws error like this, Query: CREATE TABLE IF NOT EXISTS payment_status ( STATUS_ID int(3) unsigned NOT NULL DEFAULT '0' , STATUS_NAME varchar(50) NOT NULL DEFAULT '' , DESC varchar(100) , PRIMARY KEY (STATUS_ID), UNIQUE KEY XPKPAYMENT_STATUS (STATUS_ID) ) Error: Er...

PHP: Mixing old mysql with PDO

I'm writing an application which makes use of some legacy code. The newer code uses PDO, while the older uses the original mysql library. A large amount of data is input in a transaction in the first code, so that I can roll back on error, but the legacy code is called at some points and needs to see the same data; unless the connectio...

MySql / Odbc connection problem

I'm accessing a MySql database via ODBC. It normally works fine, but if the database is stopped and restarted I have to restart my application in order to reconnect to the database. The code for accessing the database is like this: OdbcConnection connection = new OdbcConnection(connectString); OdbcCommand command = conn...

How would I incorporate DATEJS into a form driven by PHP?

I'm creating a simple app (PHP & MYSQL) that collects information about an event, and I'd like to incorporate natural language processing in the date collection portion. I stumbled upon date.js (www.datejs.com), and it seems like a great fit, but I'm not sure how I'd incorporate it into the input form and then pass the converted string a...

Update not working for MySQL and PHP

hi all, I am trying to update the entry in the database i ahve encrypted the field uniqueID i think that is causing some problem. $query = "SELECT UniqueID FROM configuration"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); echo $num_rows; while($row = mysql_fetch_assoc($result)) { $dbuniqueID = Encryption...

When to choose Oracle over MySQL?

I am a MySQL fan , however i want to know in which situations choosing Oracle over MySQL seems like the way to go .. like what would be the indicators which would make you say .. "I need Oracle for this project" Update: As another fellow SOer pointed out, dont limit your answers to Oracle ... if you know of something better , please poi...

Mysql join 2 database and 3 tables query?

SELECT db1_t1.userid as userid , db1_t1.customer_id as vw_customer , db2_t1.customers_id as customer , db2_t1.orders_id as order FROM database1.table1 db1_t1 LEFT JOIN database2.table1 db2_t1 ON db1_t1.customer_id = db2_t1.customers_id It gives me this error: You have an er...

MySQL query using INNER JOIN, Not returning what i'd expect.

Hi, I'm having trouble with the following query: SELECT costingjobtimes.TimeStamp, costingdepartment.DeptDesc, costingemployee.Name, costingjobtimes.TimeElapsed FROM costingemployee INNER JOIN (costingdepartment INNER JOIN costingjobtimes ON costingdepartment.DeptID = costingjobtimes.DeptID) ON costingemployee.EmployeeID = costingjobt...

Mysql query, select 2 databases with 4 tables + nested SELECT?

This is my current query $sel = "SELECT db1t1.userid, db1t1.customer_id, db2t1.customers_id, db2t1.orders_id, db2t2.products_price FROM database1.table1 db1t1 LEFT JOIN database2.table1 db2t1 ON db1t1.customer_id = db2t1.customers_id LEFT JOIN database2.table2 db2t2 ON db2t1.orders_id = db2t2.orders_id WHERE db1t1.use...

drag drop mysql web form builder

Hi, I would like to have a tool with which I can easily develop(dragNdrop) front-end for mysql table and publish it to web. I am not sure whether I can try oracle forms, as my database is MySQL. Even if I can use Oracle forms to connect to MySQL, I would like to know any other third party tool which can do the job easily & quickly. Th...