mysql

import from oracle to mysql by using CTL

Hi all, how can i import data from an oracle database to a mysql database by using CTL file (generate with Toad for oracle)? Thank in advance Andrea ...

Easiest way to import data from My Sql to Sql Server

For a new project I have to import the pre-existing data from MySql. In this site I have found many options, some including the installation of drivers. What is the fastest & easiest way to do it? Update: this would be just a one time import ...

MySQL - Skip Duplicate WordPress Entries

I'm writing a script to display the 10 most recently "active" WordPress blog posts (i.e. those with the most recent comments). Problem is, the list has a lot of duplicates. I'd like to weed out the duplicates. Is there an easy way to do this by changing the MySQL query (like IGNORE, WHERE) or some other means? Here's what I have so far:...

What should every PHP programmer know ?

I would to be a PHP/Mysql Programmer what is the technologies that i must know ? Like :- Frameworks IDEs Template Engines Ajax and Css Frameworks please tell me the minimum requirements that i must know , and tell me your favourite things in the previous list ? thanks ...

Why does MyEclipse's Hibernate Reverse-engineering creates multiple classes when mapping certain tables?

I have a table in my MYSQL database which does not have a primary key, but has a unique key on two columns. When using MyEclipse's Hibernate reverse engineer tool to create a mapping for that table, it generates two classes, one for named after the table itself, and one with an "Id" suffix. It seems most of the useful methods ended up ...

Hibernate: Automatically creating/updating the db tables based on entity classes

I have the following entity class (in Groovy): import javax.persistence.Entity import javax.persistence.Id import javax.persistence.GeneratedValue import javax.persistence.GenerationType @Entity public class ServerNode { @Id @GeneratedValue(strategy = GenerationType.AUTO) Long id String firstName String lastName } and m...

MySQL Joining Problems

The following query returns strange results for me: SELECT `Statistics`.`StatisticID`, COUNT(`Votes`.`StatisticID`) AS `Score`, COUNT(`Views`.`StatisticID`) AS `Views`, COUNT(`Comments`.`StatisticID`) AS `Comments` FROM `Statistics` LEFT JOIN `Votes` ON `Votes`.`StatisticID` = `Statistics`.`StatisticID` LEFT JOIN `Views`...

How do I convert an SQL Server SMALLDATETIME to a Unix timestamp?

How do I convert an SQL Server SMALLDATETIME to Unix Timestamp? date was stored as CAST(0x96040474 AS SmallDateTime) in MS Access DB. Data was dumped to SQL and I'm looking to convert those times to Unix Timestamps for MySQL. Thanks AO ...

How can I tell when a MySQL table was last updated?

In the footer of my page, I would like to add something like "last updated the xx/xx/200x"; with this date being the last time a certain mySQL table has been updated. What is the best way to do that ? Is there a function to retrieve the date ? Should I make an access to the database everytime my footer is displayed ? ...

How an experienced MS-SQL developer can get started with MySQL?

I am experienced MS-SQL developer who has written countless queries and almost countless store procedures. How would I get started from what do I download? What is the equivalent of SQL Server Management Studio? Where can I go to learn the syntax differences between the different databases? Cost is an issue this must be all done ...

How can I get the database name from a Perl MySQL DBI handle?

I've connected to a MySQL database using Perl DBI. I would like to find out which database I'm connected to. I don't think I can use: $dbh->{Name} because I call USE new_database and $dbh->{Name} only reports the database that I initially connected to. Is there any trick or do I need to keep track of the database name? ...

How can I fix this mysql query?

I have a query as follows: SELECT website_url, website_id, website_shady, (sum(dstats_hits)+website_in_ballast) as total_in, (sum(dstats_hits_out)+website_out_ballast) as total_out, sum(dstats_hits_out_paid) as total_paid, website_in_ballast, website_out_ballast FROM website...

Is there a disadvantage to using "USING" instead of "ON" in MySQL?

Two snippets of MySQL: SELECT * FROM annoyingly_long_left_hand_table LEFT JOIN annoyingly_long_right_hand_table ON annoyingly_long_left_hand_table.id = annoyingly_long_right_hand_table.id; vs SELECT * FROM annoyingly_long_left_hand_table LEFT JOIN annoyingly_long_right_hand_table USING (id); Given that both...

MySQL: how to get the list of tables using ODBC

I am connecting to a MySQL DB trough a terminal who only have a program with an ODBC connection to a MySQL DB. I can put querys in the program, but not access MySQL directly. I there a way to query the DB to obtain the list of tables? ...

MySQL: how to get the list of fields in a table using ODBC

I am connecting to a MySQL DB trough a terminal who only have a program with an ODBC connection to a MySQL DB. I can put querys in the program, but not access MySQL directly. I there a way to query the DB to obtain the list of fields in a table other than select * from table ?? (don't know why but the select returns a error) ...

showing related data from mysql in ajax

Hello, I have the following code, which works fine: echo '<div id="Result">Content goes here</div>'; echo "<h1>Table: {$table}</h1>"; echo "<table border='1'><tr>"; // printing table headers for($i=0; $i<$fields_num; $i++) { $field = mysql_fetch_field($result); echo "<td>{$field->name}</td>"; } echo "</tr>\n"; // printing table...

How to Pass Variables Into PHP Ajax Handler Script?

Hello, I have a small ajax php application, which outputs data from a mysql db into a table. The rows are links, which when clicked will call an ajax function, which in turn will call another php file, which displays a different query from the same database in a layer without reloading the page. I would like to know how to synchronize ...

How to store a java.util.Date into a MySQL timestamp field in the UTC/GMT timezone?

I used a new Date() object to fill a field in a MySQL DB, but the actual value stored in that field is in my local timezone. How can I configure MySQL to store it in the UTC/GMT timezone? I think, configuring the connection string will help but I don't know how. There are many properties in the connection string like useTimezone, serve...

mysql php : switching between mysql databases is slow

In my php script which connects to mysql, I have to query 2 databases in the same script to get different information. More specifically Faxarchives in one database and Faxusers in the other. In my code I query faxusers and then foreach user, I query Faxarchives to get the user history. I might do something like: function getUser...

Connect to a MySQL server over SSH in PHP

I'd like to establish an ssh tunnel over ssh to my mysql server. Ideally I'd return a mysqli db pointer just like I was connecting directly. I'm on a shared host that doesn't have the SSH2 libraries but I might be able to get them installed locally using PECL. If there's a way that uses native commands that would be great. I was thin...