mysql

get the records for the latest timestamp mysql

how do I get all the records for latest date. The date filed in my db is called recordEntryDate and it is in this form 2010-01-26 13:28:35 Lang: php DB: mysql ...

How to save content uploaded by user?

I am planning to start a site in which the content is generated by the users. What is the best method to save the data submitted by user? Is the method of saving the data in phpmyadmin database a good idea considering that the data submitted by users is large similar to a blog post. Btw I'm good in working with php and mysql but I'm no...

MySQL problem with Insert Clause

Hi! I've spent hours on this problem and for the life of me I can't figure it out, I have an Insert MYSQL command that is not executing, I've tried manually running the query on phpMyadmin and it actually does work but for some reason when the site runs the command, nothing is entered into the database. I have $sql = "INSERT INTO before...

Mysql query for finding 10 close marks of class

I want nearest 10 marks for particular student. For example John has marks 73 then i have to find 10 student with marks greater than 73 in ascending order nearest to John. My Table structure is (id,name,marks). ...

Using Fulltext Index Relevance turning up as 0

I have a similar query that I use across several different tables, however on this table, for some reason All of my results are coming in with a Relevance of 0.. Could anyone provide some insite to why this might be happening? Cheers SELECT City, MATCH ( Street, City, State, Zipcode ) AGAINST ( 'San|Diego' ) AS Relevance FROM ...

MySQL query using multiple criteria from checkboxes

I would like to do a multiple search query usig multiple checkboxes which represent particular textboxes. How do i create a mysql query which will be filtering the checked and unchecked checkboxes (probably using if statements)? The query should be able to filter the checked and ucnchecked boxes and query them using the AND condition. ...

where id = multiple artists

Any time there is an update within my music community (song comment, artist update, new song added, yadda yadda yadda), a new row is inserted in my "updates" table. The row houses the artist id involved along with other information (what type of change, time and date, etc). My users have a "favorite artists" section where they can do...

Why does this properly escaped SQL query fail?

Here's the query: INSERT INTO jobemails (jobid, to, subject, message, headers, datesent) VALUES ('340', '[email protected]', 'We\'ve received your request for a photo shoot called \'another\'.', 'message', 'headers', '2010-04-22 15:55:06') The datatypes are all correct, it always fails at the subject, so it must be how I'm escaping the ...

ADO.NET Data Services for MySQL

Hey! I've searched high and low for this, and no luck. Is there a way that CRUD methods for a MySQL install (Linux box) be exposed via ADO.NET WCF Data Services? I would really love to leverage this in my WPF app :) Thank u! EDIT: :D I am aware that it's called Windows Communication Foundation, but just thought I'd put it out the...

Case insensitive duplicates SQL

So I have a users table where the user.username has many duplicates like: username and Username and useRnAme john and John and jOhn That was a bug and these three records should have been only one. I'm trying to come up with a SQL query that lists all of these cases ordered by their creation date, so ideally the result should be somet...

Hibernate Relationship Mapping/Speed up batch inserts

I have 5 MySQL InnoDB tables: Test,InputInvoice,InputLine,OutputInvoice,OutputLine and each is mapped and functioning in Hibernate. I have played with using StatelessSession/Session, and JDBC batch size. I have removed any generator classes to let MySQL handle the id generation- but it is still performing quite slow. Each of those table...

SQL Query Update is not working

Hey guys, I am using pawn script for something, and everything works great except for one of my queries. For some reason, it will not work, and I am hoping it is simple enough someone can spot my mistake as I have been banging my head on it for days. http://ampaste.net/m6a887d30 The two highlighted lines are the queries that are not w...

MySQL select date, join statistic data - how?

I have some statistics I need to report on a monthly basis. I need my query to return 0's for statistics which aren't there. The only way I know to do this is to use SQL to generate a list of days within the specified time period and LEFT JOIN the statistic data that I need to report on. Problem is.... I've never not selected from a t...

Which database and language is better at handling Unicode?

which database should I use, if my application is going to be in multiple languages (including Chinese, Japanese etc)? In other words, is MySQL better or worse than Postgres to handle unicode etc? (these are the only two databases my hosting company has) Also, which language is better for handling unicode? PHP or Ruby/Rails? ...

Navigating by foreign keys in ADO.NET Entity Framework/MySQL

I am using ASP.NET MVC2 on top of a MySQL database in VS2008. I am using the MySQL ADO.NET connector 6.2.3 to provide the connection for the ADO.NET Entity Data Model. This is mostly working ok, however navigating via foreign keys is causing me a real headache! Here is a simplified example.. Car (Table) CarID PK Colour Doors Manufactu...

Delphi - MySQL Best Data aware components to use

I need my application to connect to my web server's MySQL database, what is the best option for this. Perfered Data aware Component. I tried zeos 7, but I keep getting the error: SQL error: Client does not support authentication protocol requested by server; consider upgrading MySQL client and have not been able to fix it. Thanks -Br...

Is there a way to figure out which web page is associated with which query?

I'm running a LAMP stack. When I go into phpmyadmin, I can see that there are quite a number of sleeping connections which probably should be closed. Is there a way, using either Apache or MySQL, to determine on which pages those connections are created? ...

How do I change the Django default test database?

The production database is named: project_db The default test db is: test_project_db My production server provider requires the database name start with the account name. So I could go with: projects_db_test or some variant. ...

MySQL multi CREATE TABLE syntax help?

Hi guys, I'm trying to write a MySQL script that creates several tables. I have: CREATE TABLE `DataBase1`.`tbl_this`( ... ); CREATE TABLE `DataBase1`.`tbl_that`( ... ); ... (14 more) ... BUT, only the first CREATE TABLE statement is executed. I get no syntax errors. Erm, am I missing the MSSQL equivalent of GO ? What am I doing wro...

Storing data in a MySQL database using MySQL & PHP

I'm new to PHP and MySQL and I'm trying to store a users entered data from the following fields $skill, $experience, $years which a user can also add additional fields of $skill, $experience, $years if needed so in instead of 1 of each field there might be multiples of each field. I was wondering how can I store the fields in my MySQL ...