mysql

How to remove Installation of MySQL on Mac OS X

Hello, i need to install older version of mysql server on mac os, but i have newer version i try to remove this newer installation (5.1), but when start old version install (5.0b) message "MySQL 5.0.51b-community for Mac OS X can't be installed in this disk. A newer version of this software alrady exists on this disk" i can't recognize...

How do I script a php file to display an image like <img src="/img.php?imageID=32" />?

Hi everyone, I'm storing banner ads in a mysql table or I should say just the file name e.g: 'imagename.jpg' or 'banner3.gif'. Obviously I am wanting to track when these banners are loaded so I'm thinking to create a php file called img.php and call it like so <img src="/img/img.php?imageID=3" /> And that would pull out the image w...

Information required - PHP application distribution based on user signup

Take for instance Yahoo Mail or Twitter. When someone signs up to use their service, they'll need to automatically deploy a new database, application folder and so on - I assume! I am planning to write an PHP application to let people add and edit invoices. Good examples would be Zoho Invoice, http://www.getballpark.com/, etc. They sure...

Opening MySql database to search engines.

Hi, Most of my content on my web application gets stored in MySql database. I want to open this content for search engine to index it. What is the best solution to do this. Best could be either performance oriented or ease of implementation. Thanks in advance! ...

MySQL status swap for bitwise operators

I am looking for a solution/best practice to do a swap of values for a status flag. The status INT(3) in mysql has a few values, and I'd like to be able to swap the LIVE and NOT_LIVE values around, without interrupting what other bitwise values are in there. If it was a flag field, as in 0 or 1, it is easy: 'status' NOT 'status' I w...

how to import from MS excel into MYSQL DB

Hello All, How do I import data from MS excel and insert in to MYSQL database ? Which language is easiest and fastest to do this task ? ...

How to Declare timestamp as variable and convert to ddmmyy format.

I have a date issue here. I have a timestamp field in mysql table called filedate. However I have tried several times to declare it and also convert it to a dd-mm-yy format. Unfortunately when I load it the date is still in timestamp format and when I then upload it claims I haven't declared the variable filedate. Any assistance pointin...

Efficient Insert Query Against Multiple Tables in MySQL

I was wondering if there is a more efficient way of doing an insert in MySQL against multiple tables than a separate insert query for each record in each table. I was thinking of doing something like this: INSERT INTO table1 (t1c1, t1c2, t1c3), table2 (t2c1, t2c2, t2c3) VALUES ('t1c1', 't1c2', 't1c3', 't2c1', 't2c2', 't2c3'); T...

How can I connect to MySQL database on a dedicated Windows 2003 server from EC2 based app server with PHP

I have developed a web application that uses PHP and MySQL and has all been running fine from a single development server. I now want to separate things a bit and place an app server within Amazons cloud that will receive and process uploaded files. The database is going to remain on the dedicated server but will need to be accessed by t...

Limiting MySQL results within query

I'm looking to see if I can get the results I need with a single query, and my MySQL skills are still in their adolescence over here. I have 4 tables: shows, artists, venues and tours. A simplified version of my main query right now looks like this: SELECT * FROM artists AS a, venues AS v, shows AS s LEFT J...

What's wrong with my select query?

I've written this code in order to fetch all the records in a table; however for some reason it's not working: function GetAllData(){ $result = mysql_query("SELECT * FROM a2h_member_type"); while($row = mysql_fetch_array($result)) { echo $row['member_type_id'] . " " . $row['member_type_name'] . " " . $row['descripti...

How come certain values are not being displayed using PHP foreach loop?

I am working on a website using a PHP script to display information formatted a certain way from a MySQL database. I want the date values from the database (which are formatted as YYYY-MM-DD) to be displayed as Month YYYY. The perhaps-not-efficient-enough code I'm using to display the months as words is below: foreach($monthstart as $...

Caching question MySQL or Filesystem

Hi, is there a noticeable speed performance difference when you cache the data which you retrieve from the database to a file on the filesystem (eg.: htdocs/cache/cachefile) rather than grabbing it directy from the MySQL DB? Thanks a lot! ...

How to convert records in a table to xml format in PHP?

I fetched some records from a table named a2h_member in php. i want to convert it into XML format. How can i do this?. Give me some suggestions or code. Please Help me ...

PHP/MySQL - algorithm for "Top Rated"

So I just built a star-rating system and and trying to come up with an algorithm to list the "Top Rated" items. For simplicity, here are the columns: item_name average_rating (a decimal from 1 to 5) num_votes I'm trying to determine the "sweet spot" between number of votes and rating. For example... An item rated (4.6 / 20 votes) sh...

retrive data using foreach() from table in php code

Please help in php code $data = mysql_query("SELECT * FROM a2h_member_type") or die(mysql_error()); foreach($data as $row){ foreach($row as $key=>$value){ echo $key; echo $value; } ...

Extract birthdays in natural order

Given the folowing mysql table: ID|name|year|month|day ---------------------- 1 |john|1978|5|1 2 |mike|1979|7|23 3 |bob |1985|2|14 4 |joe |1964|2|16 5 |jane|1975|9|22 I'm trying to extract the users in order of their birthday events, upcoming birthdays first. So, if the query is executed on September 16, the order should be: j...

Array variable in mysql

Is there a way in a mysql script to declare an array(or any collection) and looping over it for doing stuff. Ex : SET @myArrayOfValue=[2,5,2,23,6] for each @value in @myArrayOfValue INSERT INTO EXEMPLE VALUES(@value, 'hello'); end for each Thanx in advance. ...

[MySQL] How to insert additional values in between a GROUP BY

Hi, i am currently making a monthly report using MySQL. I have a table named "monthly" that looks something like this: id | date | amount 10 | 2009-12-01 22:10:08 | 7 9 | 2009-11-01 22:10:08 | 78 8 | 2009-10-01 23:10:08 | 5 7 | 2009-07-01 21:10:08 | 54 6 | 2009-03-01 04:10:08 | 3 5 | 2009-02-01...

Migrate MS Access to MySQL

I'm getting data as an Access file. My application uses MySQL/Java. I'd like to parse the Access data, and stick it in MySQL. Is there a Java tool that will help me do this? ...