mysql

Phing: MySQL import

I'm trying to setup an mysql import script in Phing, but the "<" is causing XML errors. Any ideas? <exec command="mysql -u${mysql.username} -p${mysql.password} -h ${mysql.server} ${mysql.database} < ${sql.file}" /> I'm looking at making dbDeploy doing this, but it'd be great if there was an easy way for this to work (single line comm...

SQL Server To MY SQL

I got a new project from my teacher to convert database to another. How can I convert a MS SQL database into MYSQL using JAVA ...

How to know if MySQLnd is the active driver?

Maybe it's an obvious question, but I want to be sure. How can i know if it MySQLnd is the active driver? I'm runing PHP 5.3 and MySQL 5.1.37. In phpinfo() mysqlnd is listed but only with this I can't be sure if I'm using MySQLnd or the old driver... Extract of phpinfo() output mysql MySQL Support enabled Active Persistent Links ...

SQL SELECT to get the first N positive integers

I need to get a result set containing the first N positive integers. Is it possible to use only standard SQL SELECT statement to get them (without any count table provided)? If it's not possible, is there any specific MySQL way to achieve this? ...

When to use MongoDB or other document oriented database systems?

We offer a platform for video- and audio-clips, photos and vector-grafics. We started with MySQL as the database backend and recently included MongoDB for storing all meta-information of the files, because MongoDB better fits the requirements. For example: photos may have Exif information, videos may have audio-tracks where we to want to...

mysql now() Incorrect datetime value for column - error code 1292

When doing simple maths using now() ... mysql> select cdrstatuschangets from cdrs where ( cdrstatuschangets < now() - 10 ); +---------------------+ | cdrstatuschangets | +---------------------+ | 2009-09-25 13:55:50 | +---------------------+ 1 row in set (0.00 sec) show warnings; Empty set (0.00 s...

Detecting utf8 broken characters in MySQL

I've got a database with a bunch of broken utf8 characters scattered across several tables. The list of characters isn't very extensive AFAIK (áéíúóÁÉÍÓÚÑñ) Fixing a given table is very straightforward update orderItem set itemName=replace(itemName,'á','á'); But I can't get a way of detecting the broken characters. If I do something...

Changing the current count of an Auto Increment value in MySQL?

Currently every time I add an entry to my database, the auto increment value increments by 1, as it should. However, it is only at a count of 47. So, if I add a new entry, it will be 48, and then another it will be 49 etc. I want to change what the current Auto Increment counter is at. I.e. I want to change it from 47 to say, 10000, so ...

Unable to integrating SSRS 2008 with MYSQL

Hi, I would really appreciate any help for this problem. Basically I am using SSRS 2008 for reporting services. My choice of DB was MYSQL. So I installed ODBC MYSQL connector and created a DSN and used it in report design. If I preview the report in the Business Intellgence Dev Studio, I can see the records, but when I try to view in ...

How to store more than 255 char in MySQL database?

I only get set the text field in MySQL to 255, if I want to store a data longer than 255 chars, what can I do? ...

Database replication SQL Server 2008 to Mysql

I have to create real time replication from SQL Server 2008 to Mysql. It should be one directional data synchronizing. Has anybody done this before? Thanks. ...

MySQL: How to get user with most wins?

I have a table with the following fields: id, opp1, opp2, opp1_votes, opp2_votes. If one of the opps have more votes than another so we consider that he won. How can I get opp with most wins from this table? ...

How can I store a date in a MySQL database using PHP?

I want to store a date value in a MySQL database. I have one PHP page called A.php that has 3 inputs: d, m, y, where d = (1 ... 31), m =(1 ... 12) and y = (1970 to 2009). Now in b.php I collect this values and I need to store in my db. My DB has a field called dob which is of date type. How can I construct a variable of type date fro...

Ids from mysql massive insert from simultaneous sources

I've got an application in php & mysql where the users writes and reads from a particular table. One of the write modes is in a batch, doing only one query with the multiple values. The table has an ID which auto-increments. The idea is that for each row in the table that is inserted, a copy is inserted in a separate table, as a history ...

MYSQL: SQL query to get the value of autoincrement field

I have a table. The primary key is id and its auto incremented. Now when I insert a new record, I need to get the id with which the record was updated. How can I do that? If i use the query... select max(id) from table_name ...after executing I can get the id. But can I be sure that its the id of the record that was just inserted? ...

Compare database value to number of rows in another table

Hello all. For each item in the first table, there is a 'numberOf' field. The value of this field must have an identical number of rows in a related table. These are like reservation rows so multiple users can book the item at the same time. This syncronisation sometimes goes out and there are more rows than the 'numberOf' field variabl...

What are some things to keep in mind when building e-commerce sites?

hello all, In the coming months, I will be tasked with creating an e-commerce site for the first time. I've worked with e-commerce sites before, making edits and themes but never made one from the bottom up. I know this isn't a small undertaking which is why i'm doing research now! What are somethings that i would only learn from exp...

User Login with a single query and per-user password salt

I've decided to implement a user login using a per-user salt, stored in the database. The salt is prefixed to a password which is hashed with SHA and stored in the databse. In the past when I wasn't using a salt I would use the typical method of counting the number of rows returned by a query using the user inputted username and passwo...

selecting from 2 tables. MySql

How do i do select p.Quota without writing the long full name? right now i am doing SELECT c.id, c.UserName, p.Quota, cs.StatusName FROM CUSTOMERS AS c, PRODUCTS AS p LEFT JOIN CUSTOMERSTATUSTYPES as cs ON c.StatusId=cs.CustomerStatusId LIMIT 1 ; I get the error: ERROR 1054 (42S22): Unknown colu...

How to use mysql with apache tomat 6

Hello, I was using msacces n tomcat6.0 previously for my application testing and was working fine. Now I want to use myswl database through apache tomcat 6.0. I have wamp server installed on my computer so want to connect to same mysql server. I have created database succesfully on it. I have put mysql-connector-java-5.1.9 , mysql-5.0....