mysql

How to handle dynamic site localizations?

I've got a website that is currently all in English. It is an online game, so it has a bunch of different pages with static text, as well as a lot of content in a database. I am trying to expand more globally and am gearing up to release some localizations of the site. However, I'm not sure about the best way to go about setting thi...

In MySQL, if the movies table has a description field, how to do search on this description?

Say, using MySQL, if the movies table has 20,000 records, and each record has a field that is the description of the movie, up to 2k byte long. How can we search for movies with the word "nature" in its description? If possible, it is to be fast, instead of going through all the 20,000 records. (if in some other situations, like for b...

Limiting results with a join while not counting joined results?

Don't know if this is possible, I am looking a writing social network-esque code but need a bit of help. SELECT wall.Wid, wall.uid, wall.wcomment, wall.name, comment.wid, comment.comment,comment.wid FROM wall LEFT JOIN comment ON wall.Wid=comment.wid WHERE wall.uid in (SELECT fid from friends where uid = 3) Cheers guys ...

string categorization strategies

I'm the one-man dev team on a fledgling military history website. One aspect of the site is a catalog of ~1,200 individual battles, including the nations & formations (regiments, divisions, etc) which took part. The formation information (as well as the other battle info) was manually imported from a series of books by a 10-man voluntee...

Appending Comment Number Anchors to Comments

Hello, I am using a PHP file called comments.php that has a query that enters values into a mySQL table called "comment." As the query does this, it auto-generates a field called "commentid", which is set to auto_increment in MySQL. The file also contains a loop what echoes out all comments for a given submission. It all works fine a...

Adding a Line Break in mySQL INSERT INTO text

Hi Could someone tell me how to add a new line in a text that i enter in a mySql table. I tried using the '\n in the line i entered with INSERT INTO statement but '\n is shown as it is. Actually i have created a table in Ms Access with some data. Ms Access adds new line with '\n. I am converting Ms Access table data into mySql . But ...

How to lock a transaction for reading a row and then inserting in Hibernate?

I have a table with a name and a name_count. So when I insert a new record, I first check what the maximum name_count is for that name. I then insert the record with that maximum + 1. Works great... except with mysql 5.1 and hibernate 3.5, by default the reads don't respect transaction boundaries. 2 of these inserts for the same nam...

Export XML with only one MySQL request ?

I want to export in XML format some data from 7 tables (MySQL database), and then I want to import in another database. And I have a update or insert rule for data. I already have a SQL query retrieving all data, with JOINs on my 7 tables. But...when I try to put data in XML format, I reach a limit. My PHP loop can catch each row, but I...

proper Django ORM syntax to make this code work in MySQL

I have the following django code working on an sqlite database but for some unknown reason I get a syntax error if I change the backend to MySQL...does django's ORM treat filtering differently in MySQL? def wsjson(request,imei): wstations = WS.objects.annotate(latest_wslog_date=Max('wslog__date'),latest_wslog_time=Max('wslog__time'...

How do I change a MySQL table to UTF-8?

I know there are many settings for a language for a table and a database. I already created the database. I believe when I created it, it was default/LATIN. I want to change everything-I mean...both the table and the database, to UTF-8. How can I do that? thanks. ...

SQL query problem

Hello All I have 2 tables Project and ProjectList like this Project ProjectID Name ProjectListID - allow null In ProjectList ProjectListID ProjName Now what i need here, i want only those recoed from ProjectList table which ProjectListID not in Project table. I made a query but it is taking lot of time to execute. select * FROM ...

Lost connection to MySQL server at 'reading initial communication packet', system error: 113

Within my application I recently get the above error message. I did look into the internet for solutions but did not come up with anything yet. The base problem for it is that this error occurs approximately after 1000 database connections, so 1000 connections without a problem and then this error and so on. Based on this fact all the p...

A MySQL schema parser in Java?

Hi all, Does anyone know whether there is a java library for parsing a MySQL schema? In code I want to be able to determine the tables and fields specified in a schema. Or will I need to write my own? Thanks Richard. Edit: Just want to avoid re-inventing the wheel unnecessarily :) ...

Database design (MySql)::should we put html data in text field inside database table or more efficient to save inside text.txt file?

Hi, We building big Web Application and we use mysql, we want to make mysql database more fast. Some of us think if we will put message html body inside table and not inside text.txt in will make database heavy and not fast. Thanks, *Part of main table that hold message: option 1:hold html message body inside database message { id (int...

Connecting FLEX 3.0, JAVA WITH MYSQL

How to connect to MYSQL DB from Java, create table, insert data, retrieve it with datatypes. How to make use of the data to/from in Flex application. plz help me out.. i have basic knowledge in sending and receiving messages using BlazeDS. and calling JAVA METHODS USING ... ...

(database design,mysql) Is my database design good for basic shopping cart?(I new in database design)

Hi, I new in database design, I want to be sure that i make it well. Please take a look for part of my database design: My database design for basic shopping cart: //table that holds shopping cart items that customer choose(not press checkout and order //them) **shopping_cart** { id (int) product_id (int) fk product_quantity (int) cus...

Can't view order in magento

Hi, I've been setting up a fresh magento 1.4.0.1 install, working great so far. I did some test orders just to see. Everything works fine, but when I click on "view order" under "my orders", I get a bunch of error messages: There has been an error processing your request Notice: iconv_substr() [function.iconv-substr]: Unkno...

How to Resolve MySQL Error? Chaining Named Scopes

I'm trying to chain two named_scopes in my User model. The first: named_scope :commentors, lambda { |*args| { :select => 'users.*, count(*) as total_comments', :joins => :comments, :conditions => { :comments => { :public_comment => 1, :aasm_state => 'posted', :talkboard_user_id => nil} }, :group => 'user...

Is it possible to alter the cascading behaviour of existing mysql foreign keys?

I have two tables in mysql, both are type InnoDB and there is an existing foreign key from the first to the second. However, the foreign key was created without any cascading behaviour. The table is large, and any changes to indexes or new keys locks the table for ~20 minutes. Is it possible to add "ON DELETE CASCADE" behaviour to an ...

My team member not supporting to use Crystal report in asp.net web application.

My team member not supporting to use Crystal report in asp.net web application. specially Crystal report with mysql database. Is there any other report available? ...