mysql

submitting radio values in a php form to a mysql table (UPDATING VALUE IN TABLE)

i am currently building a php form utilising the jquery iphone style radios (found at http://devgrow.com/iphone-style-switches/). by default the radio value is set to NO in the mysql table for every new entry. but i am having difficulty submitting the form. how will the form be able to tell the current status of the radio button (i.e. is...

How to echo out table rows from the db (php)

i want to echo out everything from a particular query. If echo $res I only get one of the strings. If I change the 2nd mysql_result argument I can get the 2nd, 2rd etc but what I want is all of them, echoed out one after the other. How can I turn a mysql result into something I can use? I tried: $query="SELECT * FROM MY_TABLE"; $res...

How to deal with "partial" dates (2010-00-00) from MySQL in Django?

In one of my Django projects that use MySQL as the database, I need to have a date fields that accept also "partial" dates like only year (YYYY) and year and month (YYYY-MM) plus normal date (YYYY-MM-DD). The date field in MySQL can deal with that by accepting 00 for the month and the day. So 2010-00-00 is valid in MySQL and it represen...

mySQL update question

Hey all i im getting this error when trying to update a table in my database: Every derived table must have its own alias Here is my mysql query i am trying to update with: UPDATE (SELECT clientinfo.idNumber, clientinfo.theCompName, clientoffers.idNumber, clientoffers.expTimeWaiting, clientoffers.theDateStart, clientoffers.theDate...

Need to access same boolean result in all layers of web dev abstraction

I am designing a web site, and it has the ability to log in. When someone is logged in, there is at times a need to know what group they're in. Specifically, whether they are in the officer group. Currently, I have a MySQL stored proc BOOL is_officer(INT id), where id is the user id number. My question: Is it wise to make a PHP function...

Should I install multiple mysql servers in my dedicated server?

I have a dedicated server that hosts about 70 domains... some are just plain php static websites, others are wordpress websites and a few others are on ruby on rails. In the past few days I have experienced very slow queries on mysql server... Queries like: SELECT * FROM users WHERE id = 5 takes 1.8 secs... I enabled the slow q...

Self-Referential Table Fields In MySQL

I have a table which has a "foreign key" referencing itself. This would be very useful, except I am uncertain how to add the first record to such a table. No matter what I add, I cannot provide a valid "foreign" key to the table itself, having no entries yet. Maybe I'm not going about this correctly, but I want this table to represent...

Is Django double encoding a Unicode (utf-8?) string?

I'm having trouble storing and outputting an ndash character as UTF-8 in Django. I'm getting data from an API. In raw form, as retrieved and viewed in a text editor, given unit of data may be similar to: "I love this detergent \u2013 it is so inspiring." (\u2013 is & ndash; as an html entity). If I get this straight from an API and...

Database app on iphone - architecture question

So this question is more around the design decision than anything else.Essientially, I want to build a iPhone/iPad app that will allow users to manage their database. Now there are two ways of doing this (i think). Create native objective-c drivers for each database that provide a complete wrapper around creating/managing databases (ta...

What is the best way to handle the Connections to MySql from c#

I am working on a c# application which connects to MySql server. There are about 20 functions which will connect to database. This application will be deployed in 200 over machines. I am using the below code to connect to my database which is identical for all the functions. The problem is, i can some connections were not closed and stil...

Rails: Generated tokens missing occasionally

We generate an unique token for each user and store it on database. Everything is working fine in the local environment. However, after we upload the code to the production server on Engine Yard, things become weird. We tried to register an account right after the deploy. It is working fine and we can see the token in the db. But afte...

How to take the backup of full database using mysql?

How to take the backup of full database using mysql? ...

How to select rows that don't have value in a second table

Basically I have a main table (accounts) and a meta table (accounts_meta)... The meta table looks like this: id | account_id | meta_key | meta_value What I want to do is only select accounts that do not have 'referrer_paid' as a row in the accounts_meta table... Here is my code so far... SELECT a.* FROM accounts AS a LEFT JOIN a...

performance of mysql +php

hi, I am using mysql driven application where in all data comes from mysql and display it using php. when designing the DB what all precautions must be taken so that mysql gives best performance. i had a small doubt . I have text column in my form , and i dono how much length data will be entered . So instead of varchar(255) if i c...

is there any tools could help to convert innoDB table into NDB table for mysql cluster?

is there any tools could help to convert innoDB table into NDB table? I want a tool help to replace all foreign key by trigger. Should I have to do it by manual for each FK? ...

What is the easy way to import large database to mysql using phpmyadmin?

I need to import an database(sql file) which is about 120M is size, but in phpmyAdmin, it is not allowed to import more than 8 MB. How to solve this? ...

DQL Query fails

I've got 2 tables in an MySQL DB, im using doctrine 1.2 and symfony 1.4.4 Installedbase and Spare Installedbase: ib_id app_id location and Spare: spare_id app_id amount Now i want to join the to tables to show how many of the app are in the spare. e.g. $q = self::createQuery("l") ->select('i.*, s.*') ->from('InstalledBase i, Spa...

Correct pronunciation of MySQL ?

Might sound little odd, but it's quite important for me for some presentation issues. So should it be : "m|y|s|q|l" ? (spelled) "my squale" ? "my seek well" ? or something completely different? ...

How to copy a Database from one server to another server in PHP?

I have a Database in Local server named 'empData' and i want that all the data from that database to be copied to another Database, which is in the another server(web server) with the name 'empDataBackup'. I have tried this code mysql_query("INSERT INTO empData.backup_emp SELECT * FROM empData.emp"); But it did not work as both the dat...

OOP PHP and MySQL

Hi I'm new to OOP with PHP. I'm wondering how OO comes into play when selecting data from a table. i.e. i have a users table and a user profile page. So I have a User class. Do I select the user data from the table then create a new object of class User and define the properties? Thanks for anyone that can clear this up for me! Regards...