mysql

MySQL InnoDB lock question

Hi All: I have a question about MySQL InnoDB. For example: I have the following table created: mysql>CREATE TABLE IF NOT EXISTS `SeqNum` ( `id` varchar(10) NOT NULL, `seq_num` BIGINT(30) default 0, PRIMARY KEY(`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; Query OK, 0 rows affected (0.00 sec) mysql>INSERT IG...

JDBC Video Tutorials

I am trying to learn how to connect my Java code to an MySQL database. I am looking for some good video tutorials (if none exists, I'd be interested in non-video tutorials). Thanks in advance, this will really help me! ...

MySQL/Java set<type> and get<type> What types perform better?

Given this java code... PreparedStatement s = prepare("SELECT ...") ResultSet r = s.executeQuery() r.next() s = prepare("UPDATE ...") s.setInt(1, r.getInt(3)) s.setInt(2, r.getInt(1)) s.executeUpdate() s = prepare("UPDATE ...") s.setInt(1, r.getInt(3)) s.setInt(2, r.getInt(2)) s.executeUpdate() It seems to me that MySQL JDBC would hav...

how can i get mysql results with alphabetical pagination

how can i get mysql results with alphabetical pagination i.e i have 2 fields i.e id and name in mysql table and following html links for pagination A B C D E F G ....... by clicking on A i want to get results names starting with A how can i do that with php ...

Materialized views with MySQL

Emulated materialized views with MySQL has good performance? I'm learning how to do with this link thanks Correction: "Materialized views" to "Emulated materialized views". ...

MySQL slow query at first, fast for sub queries

PHP: I have a simple pagination script which uses two queries. MySQL: Using server version 4.1.25 - I have two tables (products, categories) with the item_num field tying them together to retrieve products via category and both have unique ID fields which are indexed and auto-incremented. They're both MyISAM types. Query #1: SELECT COU...

Blank page on mysql connect

I have a php function ( "mconnect") for connecting to mysql . Sometimes in full load i get a blank page with "[]mconnect: mysql_connect" In this function i have custom messages for mysql error 1040 and 2002 -- connection errors In logs nothing appears when this error occur I use lighttpd 1.4.28 with php-cgi 5.2.0 and mysql 5.0.32 debian ...

SQL Query Error

What is wrong with this Query? INSERT INTO Registration (`Status`, `String`) VALUES ('Confirmed', '0') WHERE `String` = '". mysql_real_escape_string($user) ."' 1A: UPDATE Registration `Status` = 'Confirmed', `String` = '0' WHERE `String` = '". mysql_real_escape_string($user) ."' ...

1 way encryption and 2 way encrption

what's the difference between 1 way encryption and 2 way encryption with php and MySQL? ...

Best way to develop/manage/design recurring tasks/calendar

An example of what I'm talking about is similar to Google Calendar. When a new recurring task is created. After creating the recurring task "template" - which all of the individual tasks are based on, do you create all of the individual tasks and store them in the database? or do you just store the "template" recurring events and their...

Storing boolean values: bundle or individually?

Hello, I have about 50 discrete boolean values that I need to store in the database. These are logged every few seconds so I will be storing a lot of them over time. The way this data would be used is: 1) Access a bulk of time to see flag status history 2) Find times at which flag changed status Once stored, the records will not be u...

Mysql Database design - checklist/quiz application

hello, I'm currently 'learning' codeigniter, php and mySql all at once as I try and create a "checklist" type of website, where visitors sign up, create a project and are asked a list of questions, where they must input certain fields I'm a little stuck on my mySQL DB-design... (completely stuck actually) what it comes down to is... ...

Trouble structuring MySQL query with one-to-many over multiple tables

I have a blog-style app that allows users to tag each post with topics. I keep this data in three separate tables: posts (for the actual blog posts), topics (for the various tags), and posts_topics (a table that stores the relationships between the two). In order to keep the MVC structure (I'm using Codeigniter) as clean as possible, I...

How to get scalar result from prepared statement?

Is it possible to set the result from a prepared statement into a variable? I am trying to create the following stored procedure but it is failing: ERROR 1064 (42000) at line 31: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'stmt USING @m, @c, @...

mysql php forum list

here are my tables topics -id -title -category_id posts -id -topic_id -user_id -date -time -txt user -id -username i want to list for a category every topic with the following information the author's username (who posted first), number of replies,the name of the last reply's author, and the date of last post sorted by the date of ...

Produce a MySQL info message similair to "/* 0 rows affected, 246 rows found. Duration for 1 query: 0.109 sec. */"

G'Day, In a MySQL trigger is it possible to generate an information message so that it will flow down the connection (Using AnyDAC & Delphi) so that it can be displayed on the client? There does not appear to be a PRINT statement like MSSQL available in MySQL. I realise you can do SELECT "MyMessage" as a way to do debugging, but I want...

SQL query to combine several tables to find price of item every day

I am trying to build a table to show me the price of an item each day over a specified time period. I begin with three tables: one containing the sale price with a start and end date, one containing the regular price of an item and when it started at that price, and one date table that just has dates for filling in blanks. Tables: S...

MySQL query problem.

When a user sends a friend request and accepts it the friends info and pic are displayed perfectly on the users side but on the friends side the friends own pic and info is displayed instead of the user who friended the friend how can I fix this problem? users friends table CREATE TABLE users_friends ( id INT UNSIGNED NOT NULL AUTO_I...

How best to store web application images in the filesystem

What is the best practise for storing a large number of files that are referenced in a database in the file system? We're currently moving from a system that stores around 14,000 files (around 6GB of images and documents) in a MySQL database. This is quickly becoming unmanageable. We currently plan to save the files by their database p...

MySQL check id whether is in another table

How to check whether the id from one table is in another table in the same database. If it is then the row should not be returned. table1: id int(11) unsigned primary key, data varchar(25) default '' table2: id int(11) unsigned primary key, tableone_id int(11) unsigned, another_data varchar(11) default'' the query checks whether id fr...