mysql

How to know when escape is necessary for MySQL

I'm in the process of building a site with CodeIgniter. This is the 1st site that I've built myself that interacts with a database. I'm using MySQL for this project. How can I tell if data needs to be escaped before saving it to the database? ...

Calculation with RESTful web service with MySQL database

I am now making some RESTful web services with MySQL database. I used NetBeans to create the resources of RESTful service with MySQL, and now I can now use GET and POST/PUT to list and add/modify data entities in the MySQL server. Currently, I wish to make some calculations right after a client makes the POST activities, then the poste...

Top 10 collection completion - a monster in-query formula in MySQL?

I've got the following tables: User Basic Data (unique) [userid] [name] [etc] User Collection (one to one) [userid] [game] User Recorded Plays (many to many) [userid] [game] [scenario] [etc] Game Basic Data (unique) [game] [total_scenarios] I would like to output a table that shows the collection play completion percentage fo...

which one run faster in mysql

which one run faster in mysql: a query with multiple joins or that query with using nested select? ...

MySQL 6.0 Release Date?

Any idea when MySQL 6.0 Release Date might be? Nothing specific, more like "second half of 2010" works. ...

Innodb setting in xampp doesn't seem locate my.cnf file....

I created a new mysql database and i want to use foreign keys with it... I googled and found out this... InnoDB is one of MySQL storage engines, it supports transactions, row-level locking, and foreign-keys. However, by default, InnoDB is not enabled by XAMPP. To enable it, locate the my.cnf configuration file (normally in C:/xampp/mysq...

How do I redirect a page in php

I'm having difficulties in the making the logout code for php to work. When I click on the logout button, it will go back to the home page, but when I click on the back button in the browser. I can still access the previous page, wherein the user must be logged on to access it. So I'm thinking of redirecting to the login page when the u...

Joomla syntax for mysql last inserted id?

What is the joomla syntax for mysql last inserted id? ...

Insert a bunch of duplicate rows into a mysql table

I need to insert 50 rows into a mysql table. They should all be exactly identical, besides the primary key. Is there a query that can do this? ...

Is there any inbuilt function to insert values in db used in Joomla framework?

Is there any inbuilt function to insert values in db used in Joomla framework? I am looking for the insert query in adminitrator folder for #__menu table and other tables, but i can only find the update select and delete queries on searching in Dreamweaver, So please tell me is there any inbuilt function that Joomla uses for insert quer...

What is wrong with mysql query?

I use the following mysql query, DELIMITER $$ DROP PROCEDURE IF EXISTS `allied`.`aboutus_delete`$$ CREATE DEFINER=`allied`@`%` PROCEDURE `aboutus_delete`( IN p_Id int(11) ) BEGIN if exists( select aboutUsId from aboutus where aboutUsId=p_id and isDeleted=0 ) ...

User welcome message in php

How do I create a user welcome message in php. So that the user who has been logged on will be able to see his username. I have this code, but it doesn't seem to work. <?php $con = mysql_connect("localhost","root","nitoryolai123$%^"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("school", $co...

SQL query: Delete a entry which is not present in a join table?

Hi, I’m going to delete all users which has no subscription but I seem to run into problems each time I try to detect the users. My schemas look like this: Users = {userid, name} Subscriptionoffering = {userid, subscriptionname} Now, what I’m going to do is to delete all users in the user table there has a count of zero in the subscr...

MySQL ORDER BY date and team

I would like to order by date and then team in a MySQL query. It should be something similar to this: SELECT * FROM games ORDER BY gamedate ASC, team_id AND it should output something like this: 2010-04-12 10:20 Game 1 Team 1 2010-04-12 11:00 Game 3 Team 1 2010-04-12 10:30 Game 2 Team 2 2010-04-14 10:00 Game 4 Team 1 So that Team 1...

How to save Map objects in Java to MySQL database

I have Java Map (out of Strings and Ints) objects that I want to save to a database. Is there a standard way to go about this task? Is there a way to compress the Map to take less space on the harddrive? ...

Force 'Replace Into' to use a certain index

I have a MySQL (5.0) table with 3 rows which are considered a combined Unique Index: CREATE TABLE `test`.`table_a` ( `Id` int(11) NOT NULL AUTO_INCREMENT, `field1` varchar(5) COLLATE latin1_swedish_ci NOT NULL DEFAULT '', `field2` varchar(5) COLLATE latin1_swedish_ci NOT NULL DEFAULT '', `field3` varchar(5) COLLATE latin1_swedis...

to take values of checkbox in table attributes

i have a database patient with 3-4 tables n each table has about 8 attributes.... i have a table medical history which has attribute additional info ... under which i have 5 checkboxes.... all the values entered are taken up except the chekbox values..... plz help ...

Intersect in mysql

Hello everyone I need to implement following query in mysql (select * from emovis_reporting where (id=3 and cut_name= '全プロセス' and cut_name='恐慌') ) intersect ( select * from emovis_reporting where (id=3) and ( cut_name='全プロセス' or cut_name='恐慌') ) I know that intersect is not in m Mysql. So I need alternate way. Please guide me.... ...

Zend Framework: How to download file from mySql Blob field.

I am uploading files(any type) in MySql tables's blob field. Now I am able to get binary data from that field and when I print it, it shows binary data in firbug console. But I want to download that file as it was uploaded. How can I convert this binary data into orignal file? How to do it in zend? Thanks ...

How to form an optimal query to get high scores from a data base?

Hi, I'm using a MySQL database to store scores for my game. A very simplified version of the table would be (PlayerID - int) (Name - string) (Score - int) I'd like to form a query that would return me a set of say 10 results where the player of interest is in the middle of the table. Perhaps an example would make it more clear. I h...