mysql

Unexpected MySQL table engine change?

I've been adding tables to MySQL databases by copying & pasting from a file into the mysql command-line app. My procedure is to copy the CREATE TABLE statement from the file and paste it into my development database and then also paste it into the test database on another machine. I'm the only one using the test database. My CREATE TA...

Does HIBERNATE support the limit statement in MySql??

I am working on a project which uses Java,MySql,Struts2 MVC and Hibernate. I tried using limit statement in hql query but its not working properly. Select t from table1 t where t.column1 = :someVal limit 0,5 EDIT: I am using this as a namedQuery and calling this namedQuery using JPA Template This works correctly in MySql but when I r...

Subsonic - MySQL - Unsigned BigInt and bit issue

Well; I am using Unsigned BigInt(40) Auto Increment column as primary key. Whenever I try to query the table I am getting following exception: "Object of type 'System.UInt64' cannot be converted to type 'System.Int64'." When I dissected the code generated by Subsonic, it has declared the PK column as "long" instead of "ulong". Wh...

Hibernate JPA Template fetch

Hibernate JPA Template fetches list of objects from database. Can this be type casted to another class object list?? List<Class1> list1 = (List<Class1>) getJpaTemplate().findByNamedQuery("..someQuery.."); This is the code which i use now. Class1 relates to a table1 in database. Will I be able to fetch the records in table1 into anoth...

Visibility schedule

I want to have a simple database table to keep track of scheduled category visibility on a site index. Basically it will tell the index to display a Christmas category between Thanksgiving and Christmas day. So far I'm thinking of using a table like this, schedule_id SMALLINT, start_date TIMESTAMP, end_date TIMESTAMP, category_id SM...

How to export a single table from phpmyadmin to a comma delimited text file?

Hi, I need to export a table from phpmyadmin to a comma delimited text file. I think there is a code but can't seem to find it. I found one but it doesnt work. I need to export this table because I need to organize it and sort it and add another column so I can add data to this column. How can I do this please? Many thanks ...

MySQL calling a stored proc from another stored proc.

I am working on a stored proc (parent) that calls another stored proc (child). The child proc returns a record set with 1 row every time. What I need to do is pull the data from the child proc and use it in the parent proc. Using methodology from MSSQL I would assume I could just populate a temp table, but I am not quite sure how to do...

ASP.NET with MySql or SqlExpress?

I have already a website and moving that to the new VPS. I have option either to go with MySql database or Sql Server Express 2008 edition database (I do not want to pay for SQL Server as I can't afford as I have other expenses also). I have around 10K hits per day for my knowledge based website. My questions are If I go with ASP.NET ...

want to check day already exist

Hi frnds,i am having one table which is having 7days mon,tue...sun i am inserting some records to these fields..if i i select/enter monday or any exisiting day in drop down or text field it should say day alredy exist else it should insert...i am using following code getting some problem with this whenever i insert values its saying day ...

Securing a PHP/MySQL poll system

Hello, I'm building a PHP/MySQL poll system and I was wondering if there's any more secure method than setting a cookie + saving user IP address and checking them later. Thank you. ...

How to install mysql connector

I have downloaded mysqlDb, and while installing it I am getting errors like: C:\Documents and Settings\naresh\Desktop\MySQL-python-1.2.3c1>setup.py build Traceback (most recent call last): File "C:\Documents and Settings\naresh\Desktop\MySQL-python-1.2.3c1 \setup.py",line15, in metadata, options = get_config() File "C:\Document...

Store Password Field in Encryption Form Using MySQL and Hibernate

I am using Spring, Hibernate for developing my application. And as DB side, I have MySQL. I have an User table and that has password field of varchar type. Now, when a new user is created, I just want store password field in an encrypted form. Is there any facility provided by Hibernate to do so? Or is there any other way? ...

MySQL database search

I have a database table with chinese dictionaries (about 300 000 rows) for online dictionary. The data structure looks like this: ID ch_smpl pinyin definition ---------------------------------------- 1 我 wǒ I, me 2 我们 wǒmen we, us etc. I'm not good with php and mysql, so th...

Is it possible to combine the following two SQL statements into one?

There are two SQL statements. One is select count(*) from steventable where username='steven'; select * from steventable where username='steven' LIMIT 0 , 30; Is it possible to combine two SQL statements into one? The first one is to get how many records in steventable when username is steven, the second one is to fetch the first 30 r...

list all column names

select * from tbl Is there an easy way to list all the column names from the table that will look like this? select colA, colB, colC from tbl ...

Multiple application instances on the same database

Hello! I'm writing an application that that I'm going to provide as a service and also as a standalone application. It's written in Zend Framework and uses MySQL. When providing it as a service I want users to register on my site and have subdomains like customer1.mysite.com, customer2.mysite.com. I want to have everything in one datab...

Counting all the posts belonging to a category AND its subcategories.

I would really appreciate some help with my problem: I have 2 MySQL tables, categories and posts, laid out (simplified) like so: categories: CATID - name - parent_id posts: PID - name - category What I would like to do is get the total amount of posts for each category, including any posts in subcategories. Right now I am getting...

php - when using mysqli_fetch_assoc(result), what happens to the result?

When I have something like this: $row = mysqli_fetch_assoc($result); Does $result now have one less row in it? If I loop mysqli_fetch_assoc through all the $result, will it be empty afterwards? ...

about mysql index, multi-column or one?

I have a sql like this: SELECT * FROM tableA WHERE column_a = sth AND colun_b > sth so, how do I create index for it? One index for two column Two indexes for each column which is better? ...

Checking if a string is found in one of multiple columns in mySQL

Hi, I need to check if a string is found in one or more columns. Basically, I have a program which lets you checks multiple fields (name, surname, etc...) If both name and surname are checked and the user enters just the name, for example chris it would be easy to check it in mySQL with the LIKE parameter like this: select * from tbl...