mysql

MySQL table/row/cell data compare tool ? A la winmerge ?

Hi all, is there any such tool to compare row data and cell data between two mysql tables ? Say you have 2 different cells (values) in a row (same row idenfied by primary key) and you want to "Copy to Left" from one cell to the other, skip the next difference, and again Copy to Left (so not syncronize aka copy all). The compare part i s...

Want to delete a particular row. how to fetch the id?

$html=""; $sql="SELECT * FROM tiger;"; $rs=mysql_query($sql); while($row=mysql_fetch_array($rs)){ $html.= '<tr><td align="left"><img src="'.$row['image'].'" width="200" height="150" /></td> <td align="center" style="font:bold">'.$row['name'].' </td> <td align="center"><input type="submit" name...

mysql 5.1 partitioning - do I have to remove the index/key element?

I have a table with several indexes. All of them contain an specific integer column. I'm moving to mysql 5.1 and about to partition the table by this column. Do I still have to keep this column as key in my indexes or I can remove it since partitioning will take care of searching only in the relevant keys data efficiently without need t...

PayPal: IPN and PDT scripts working together and simultaniously

Hi, I am working on integrating PaylPal as a payment module in my webshop. I use PHP and Mysql. After a payment has been made with PayPal the customer is redirected to my webshop. At that time my IPN en DPT scripts are called simultaniously. I do that because sometimes IPN has a (tiny) delay. I don't want my customer to wait for the IP...

Catch-all search MySQL query building

I have some code that builds SQL queries to perform a lenient, catch-all kind of search on a potentially large table that loooks a little like this // $find_array derived from search string with space or comma used as a delimiter foreach($find_array as $term){ $clauses[]="( OR last_name SOUNDS LIKE '$term' OR first...

Progress mysql synchronisation

The situation: 1 Progess DB server running on Unix 1 MySQL DB server running on Ubuntu The Progress database has to be synced every night with the MySQL DB. We figured this could be done via a PHP sync script. The script connects to Progress via an ODBC driver, fetches the table and the php scripts runs through every row and formats th...

How to Select Oldest Date in SQL?

I have this sql statement: SELECT TOP (5) PartNumber,SerialNumber,MIN(WIP_CompletionDate) as dates FROM dbo.FG_FILLIN where Status='FG-FRESH' and WIP_Status<>'CMPL01' and PartNumber='P02-070161-10211-C100' GROUP BY PartNumber,WIP_CompletionDate,SerialNumber Result: PartNumber ...

MySQL / Navicat: How to syntax in View?

I have my data imported. Now I want to put syntax in view. I have 5 columns and each with a single number(0-9). I would like to seperate the number by odd and even. My case is odd = 0 and even =1 for each number. Please write step by step as possible because I want to learn it. ...

Implementation of "Most Viewed" feature database

Hi, I was wondering how to best implement a "most viewed" featured (like youtube) on my database. Let me explain the "most viewed" feature a little bit better: Basically I want to list the most visited pages/video/etc from this day/week/month, see http://www.youtube.com/charts/videos_views for an example. So I was wondering how to b...

Escape string Python for MySQL

Hello, I use Python and MySQLdb to download web pages and store them into database. The problem I have is that I can't save complicated strings into database because they are not escaped properly. Is there a function in Python I can use to escape a string for MySQL? I tried with ''' (tiple simple quotes) and """, but it didn't work. I ...

PHP & MySQL how to display data question.

I want to be able to display my posts tags array [0] => grill [1] => meat [2] => hot-dogs with a comma separating each tag and was wondering how can I do this using PHP? Stored in the database. $page_tags = Array ( [0] => grill [1] => meat [2] => hot-dogs ) Desired output. grill, meat, hot-dogs Here is the PHP & MySQL code. $pag...

MySQL Trigger - update table with value selected from another table

Hi, I'm having problems updating row in a table with value selected from another table in MySQL Trigger. My Trigger looks like this CREATE TRIGGER update_user_last_login AFTER INSERT or UPDATE ON last FOR EACH ROW BEGIN DECLARE _user_id INTEGER; SELECT user_id INTO _user_id FROM user_profile WHERE user_name = N...

calculate number of days left in an year from specific date using mysql

Hi, How to calculate the number of difference between a specific date to the current year last date. Consider I would like to show date difference between 2009-09-01 to current year last date(2010-12-31) ...

I got weird characters extracting data from MySQL db

Hi there! Well, I got a MySQL db, encoded as utf8_unicode_ci, and it runs like a charm with the current application (written in Code Igniter) Now, I'm developing a new PHP app, and when I try to recover the data, several characters are unreadable - chars appears ok in the DB with phpMyAdmin, but when I try to put it up in a webpage, it...

How do I set MySQL as the default database in Rails 3?

I started using Rails 2 last April but stopped this June because I thought learning it when Rails 3 was released would be more practical since a lot of it was completely refactored and restructured. I used to work with Ubuntu 10.04 (with SQLite3 as the default db) but now I'm using Windows 7 and MySQL 5. I already installed the gem adapt...

Utf-8 with sqlalchemy on a database with init connect

I am trying to use sqlalchemy to connect with mysql database. I have set up charset=utf-8$use_unicode=0. This worked with almost all databases, but not with a particular one. I believe it is because it has 'init-connect' variable set to 'SET NAMES latin2;' I have no privileges to change that. It works for me if I send explicit query SET...

Ordering a MySQL query result based on date

I have a bunch of entries in a database, which I want to sort via date, but the date format looks like this Y-m-d g:i:s, how could I search the database via the date, and not date time? ...

PHP SQL UPDATE works in FF and CHROME but not in IE?

Hi, the below code works perfectly in FF and CHROME but not in IE. Please help. I have commented out my santize functions as i thought they might be affecting it, but it still does the same.... nothing in IE. Thank you in advance for any assistance. <?php //IF UPDATE BUCKET CHANGE STATUS... if(isset($_POST['updatebucket'])){ $com...

how do i implement a jquery background messages?

for example when you get a new badge on stack overflow, you get the notifaction message on the top, telling you have a new badge, it deos that on the backgroung!! is thier a toturial or article that can help me with this kind eventing updates!! ...

Mysql/Php - Current date and time

I have a query that I want to update a collum with the current date time. The collum I want to update is of the type datetime. How can I get it and set it? else{ //If the last update is NULL, It must be players first page load. So set datetime equal to NOW $query = "UPDATE `stats` SET `last_ap_update` = WHERE `member_id` = {$_S...