mysql

MySQL SELECT problem with encoding (cyrillic, probably)

Hi, guys! I'm working with project on exporting data from text files to mysql database Text files contain both latin and cyrillic alphabets. Here is the bug: select * from cues where data="ГЭС"; +------+------+ | id | data | +------+------+ | 1872 | АЭС | | 4671 | ГЭС | +------+------+ Why I get "АЭС" also? The same ...

web programming choice - language, database, reliable hoster and auto-scaling

Could you please suggest - programming option? Our Web application could have 60000 database requests/second or more in future. Which is better: MS-SQL or MySQL or other? Which is better: Asp.net, PHP, JSP or other? What kind of webhosting is reliable for auto-scaling? Any good webhosters or hosting plans? Thanks a lot. ...

Parse error when trying to display a hyperlink

Hello, The link below is giving me the error Parse error: syntax error, unexpected T_STRING. Any idea how to fix it? Thanks in advance, John $link1 = "<a href='http://www.domain.com/path/comments/index.php?submission=".urlencode($submission)."&amp;submissionid=".urlencode($submissionid)."&amp;url=".urlencode($url)."&amp;countcomment...

MySQL: week date range from week number in a query

Hello! I got a database table that looks something like this: | id | clock | info ---------------------------------------------- | 1 | 1262556754 | some info | 2 | 1262556230 | some other info | 3 | 1262556988 | and another | 4 | 1262555678 | and some more It contains lo...

Compare decimals in PHP

Hi everybody, I have a form input to get a number (it is a price). It can be a decimal like 102,5. I have to compare it with an other decimal for exemple 102,6. How can handle this ? I don't want to use round() cause i get to compare exactly. ...

how to group result in subgroups in php

Hey everyone. While I'm trying to learn some PHP and mySQL, I ran into a problem that I've had some difficulty in solving. I need a PHP script that queries mySQL database for country, books, book_price. Here is my dbtable: +----+-------+----------+------------------------+ | id |Country|Books | Book_price | +----+-------...

[database] how to prevent from getting wrong ID.

database= mysql language=php I am coding program to work like this PC1 =computer1 step 1.PC1 insert data ,new ID from Auto-increment. 2.PC1 select last ID everything work fine but.. The problem when your code is used by many computers at the same mili-sec. For example PC1insert data,Auto-increment new ID 2.PC2 insert da...

Postcode Search to Nearest Marker Google Maps API

Hi Guys - I am developing a map for a client which uses AJAX and PHP/MySQL to plot markers on a Google Map. I need to be able to add an input field of some sort above the map - the user searches there postcode and the map automatically zooms in to the nearest points depending on the postcode. I have searched and crawled the web for many...

PHP: Searching for "a.."

Hi. I wish to make so when you search e.g "A" then every full_name with beginning "A" will appear. So if a user with name "Andreas blabla" will show I have this right now: $query = "SELECT full_name, id, user_name, sex, last_access, bostadsort FROM users WHERE full_name LIKE '$_GET[searchUser]'"; But still i need to s...

Getting Superfish jQuery plugin to work dynamically with several loops in PHP

Hi there, Hopefully some clever lad or ladette can help me figure out the logic for the follwoing code. I have started to use superfish jquery plugin for my navigation and have got the code working fine and easily with static links, but when I try to change that to dynamic links I am having trouble getting the 2nd level tag to work pr...

mysql replication : utilizing insert delayed

Hi , I have a batch database that i would like to replicate to a reporting database but the queries that run on the reporting database might be very long (execution time wise) to the point where they can cause a deadlock (this is happening now because both batch and reporting applications are using the same DB) , i thought of changing ...

PHP: LIKE after space?

Right now i have a column called full_name where the first and last name gets stored. It is seperated by a normal space, so a name is stored like this: "Firstname Lastname". Now when im making this search users function, i have this: $query = "SELECT full_name, id, user_name, sex, last_access, bostadsort FROM users WHERE full_name LIKE ...

In Django, getting a "Error: Unable to serialize database" when trying to dump data?

Hello. I'm getting an error when I'm trying to dump data to a JSON fixture in Djanog 1.2.1 on my live server. On the live server it's running MySQL Server version 5.0.77 and I imported a lot of data to my tables using the phpMyAdmin interface. The website works fine and Django admin responds as normal. But when I try and actually dump t...

How to Django models

I am exploring Django with MySQL & have a few things that I wanted to discuss - How can I add an index (on some field)? Can I do it through the Django Model Layer? If I want to migrate some old data into these new DB tables/models, will I have to write some script myself or does Django provide schema to schema mapping tools? If I need...

MySQL retireive rows in sorted order on a very large table

Hi, I have a MyISAM table T with the following schema: f1 (integer unsigned not null) f2 (integer unsigned not null) This table has an index on f2 and it currently contains 320 million rows, and is expected to grow at the rate of about 200,000 rows once a week. I perform the following query on this table: SELECT DISTINCT T.f1 FROM T ...

How do I build this simple mySQL query?

I would like to select all rows where field A is 'x' and field B is one of 'w', 'y' or 'z'. A and B are both strings, and I would like case to be ignored. ...

3 in 1 mysql statement.

Hi all, it is possible in one SQL statement to insert a record then take the autoincrement id, and update for the same record one specific column with this autoincrement value. Thanks in Advance. ...

Generate individual rows from date ranges

I have some information that's stored like this: DROP TABLE IF EXISTS `demographics`; CREATE TABLE IF NOT EXISTS `demographics` ( `row_id` int(10) unsigned NOT NULL AUTO_INCREMENT, `city_id` int(10) unsigned NOT NULL, `until_year` int(10) unsigned DEFAULT NULL, `population` int(10) unsigned NOT NULL, PRIMARY KEY (`row_id`) ) E...

Move Data from one table to another using on update trigger

Hi All, I New in DB development. Please help me create trigger for moving data from one table to another. I have two tables one is containing "Transaction Status" from where I want to move records on transaction status change into another table having completed transactions. so the value in one table will get deleted and will get insert...

left join return null even if there are no rows

My Table Table cat is having id,name Table user is having id,uname,catid cat Table 1 | Cate one 2 | cate two User Table 1 | sam | 1 2 | dam | 0 my query is select cat.id, cat.name from cat left join user on cat.id=user.catid where user.id=2 since there are no category with id 0 i get zero rows. What i want is even if there ...