mysql

MySQL GROUP BY with preference

Hi, is it possible to use GROUP BY with a preference for records? For instance I have whole bunch of contact data that may or may not contain all info - in a CSV sense if might look like this: Test User, Address1, Address2, [email protected] , , , [email protected] If I was to GROUP BY email, I would love to extract the more relevant recor...

How to transfer data from MYsql server to iphone

Hi All, I created a webservice in RDB with .Net.I able to transfer data from iphone to mysql and it returns the data. But i need to transfer data from RDB to iphone whenever i need (i am strucked by the ip address of iphone which one is dynamic to connect the device from a RDB) Please tell me how i will do it otherwise tell is any othe...

Is there a faster way to count records on a join...

This query gets me the profiles with the most evidence records when the profile is the actor. Is there any way to make it faster in a mysql query? SELECT profiles.*, count(*) AS counted_profiles FROM `profiles` INNER JOIN (SELECT ev.actor_id FROM evidences AS ev WHERE ev.actor_type = 'Profile') AS ev2 ON ev2....

storing shared paths in mysql using file input in php

Hi, I am trying to use a input type=file for the user to select the path from a shared network drive in php web app. I am just using this to get the file name and not doing anything with the selected file. Now, I am storing this path in the mysql database. I am not sure why, but it gets stored as ' say for example, if the path contains...

Can SQLAlchemy update the table structure ?

Hello, I am working on my first pylons + SQLAlchemy app (I'm new to both). As I change my mind on the table structure, I wish there was a similar function to metadata.create_all(), that checks if there are new columns definitions and create theme in the database. Does such a function exist ? ...

HTML checkbox change value in MySQL

I have a checkbox and I need that when it is "checked" to alter a MySQL Table value to "yes" and if it's checked when you uncheck to "no". I want to accomplish this with Ajax. How can this be done? ...

How to convert MySQL field types?

I have already come across the convert funtion. As I understand it, the basic syntax is: select convert(columnName, targetFieldType) as newColumnName from table; Running this command doesn't give me any errors, but when I check the data types they are unchanged. Even when I use commit; the data remains unchanged. In particular, I'm tr...

MySQL - explode/split input to stored procedure

I have problem, I need to explode my input to my stored procedure, but don't know how I can do it. My stored procedure has a VARCHAR(256) input which I need to split and generate insert statements. i what to explode this varchar "1,2,3,7,8,9" so I need to split that string on "," and iterate through the result ...

Can I order mysql starting at a given number?

Hi, I have many rows in a mysql table. There is an order_id column. I want to order by two columns, first by order_id and next by id(auto increment). The problem is that i entered 1, 2, 3, 4, 5... for order_id and leave blank for the others. In my example i want to display first the rows that has the numbers 1, 2, 3, 4 but instead it sho...

Fortran and mysql

Is there a library (opensource), so I can access MySQL in Fortran? ...

How to handle Facebooks new UID sizes?

I've been working a little bit on a Facebook application, but when I registered a new user to test the friend interaction the new user got a uid (100000XXXXXXXXX) that seems to big for php to handle. Saving the number in the database results in the same value (2147483647). I'm guessing this is also PHPs fault, as I would believe the ui...

Real Estate - Property Website - Using PHP - Any Suggestions?

Hello, I had an enquiry from a potential customer who would like to build a Real Estate website. He was looking to provide access to Agencies who can list their properties and add images and details to it. I know that Joomla with Mosets Hot Property can handle this well. I do not want the complex CMS behind a property management websit...

What does this DB error mean? (in AMember with VBulletin)

Vbulletin3 plugin error: DB - [] - incorrect value. Error: Table 'my_db.user' doesn't exist (where "my_db" is the name of my database). I'm trying to integrate VBulletin with AMember Pro. I've bought licenses for both. Each has their MySQL database and user (with full privileges). Each has the integration plugin for the other. Bu...

Mysql: Optimizing finding super node in nested set tree

I have hierarchical data in a nested set model (table:projects): My table (projects): id, lft, rgt 1, 1, 6 2, 2, 3 3, 4, 5 4, 7, 10 5, 8, 9 6, 11, 12 7, 13, 14 ... Pretty printed: 1 2 3 4 5 6 7 To find the nearest super node of node 3 (knowing its lft value), i can do explain SELECT projects.* FROM projects WHERE 4 BETW...

ICS replace events

We have developed a calendar for our extranet. Each week we update it with next week's courses schedule for all teachers and students of the school. This also triggers the sending per email of ICS files to those users who chose that option. Now, it almost always happens that there are last minute changes, so a need to do a new schedule ...

PHP - Get a single result using mysqli

I have descided to change from mysql to mysqli part way through a project - and run into this hicup. What is the best way to achieve this: //check if username is taken $result = mysql_result(mysql_query("SELECT COUNT(*) FROM user WHERE username='".$username."'")); I can not find an exact version of mysql_result I have tried this: $re...

Handling foreign key exceptions in PHP

What is the best way in PHP to handle foreign key exceptions on a mysql database? Is there a mysql class that can be used to simplify any code? Ideally, what I want to do, as an example, is to try to delete a record where it is the foreign key parent to any number of child tables. The foreign key throws the exception, so then I would li...

Multiple conditionals within sql query

I want to pull out the records that have a date that is LIKE today's date. I have this query $query = "select * from calendar_items WHERE expiredate LIKE '$todays_date %' or upcoming_event_featured_date like '$todays_date %' ORDER BY expiredate ASC"; Now I have 3 more upcoming_event_featured_date's: upcoming_event_featured...

Achievements / Badges system

I have been browsing this site for the answer but I'm still a little unsure how to plan a similar system in its datbase structure and implementation. In PHP and MySQL it would be clear that some achievements are earned immediatley (when a specialzed action is taken, in SO case: Filled out all profile fields), although I know SO updates ...

MySQL 24x7 - InnoDB ALTER TABLE blocks (TABLE LOCK)

Hello, we are trying to minimize (maintenance) downtimes of our mysql based application. It seems that InnoDB hotbackup will give us the possibility to do regular backups without stopping the server; Master/Slave replication will give us failover capabilities (loosing a few seconds of data due to replication lag is not great, but not ...