mysql

Which data type saves more space TINYTEXT or VARCHAR for variable data length in MySQL?

I need to store a data into MySQL. Its length is not fixed, it could be 255 or 2 characters long. Should I use TINYTEXT or VARCHAR in order to save space (speed is irrelevant)? ...

Problem with ColdFusion communicating with MySQL database

Hi, I have been working to migrate a non-profit website from a local server (running Windows XP) to a GoDaddy hosting account (running Linux). Most of the pages are written in ColdFusion. Things have gone smoothly, up until this point. There is a flash form within the site (see this page: http://www.preservenet.cornell.edu/employ/submit...

How do I setup ASP.NET MVC 2 with MySQL?

Is it possible to setup ASP.NET MVC 2 to work with a MySQL database? ...

Has anyone ever successfully make index merge work for MySQL?

Setup: mysql> create table t(a integer unsigned,b integer unsigned); mysql> insert into t(a,b) values (1,2),(1,3),(2,4); mysql> create index i_t_a on t(a); mysql> create index i_t_b on t(b); mysql> explain select * from t where a=1 or b=4; +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ |...

What does double "at" (@) marks mean in this MySQL query?

I couldn't find anything about this in MySQL documentation. SELECT accesion_id, definition FROM accesion_table WHERE search_word @@ ? OFFSET ? LIMIT Const.MAX_DISP_COUNT; ...

Ruby on Rails export to csv - maintain mysql select statement order

Exporting some data from mysql to a csv file using FasterCSV. I'd like the columns in the outputted CSV to be in the same order as the select statement in my query. Example: rows = Data.find( :all, :select=>'name, age, height, weight' ) headers = rows[0].attributes.keys FasterCSV.generate do |csv| csv << headers rows.each do ...

Password Validation

Hi there. Using mysql and php Is there any reason / value when checking a password to query the database using the user name and password (after sanitizing, of course) and recording a failed attempt when no rows are returned vs querying the database using the user name and then comparing the return password string? EDIT: To those who ...

php - disconnecting and connecting to multiple databases

Hi, I want to be able to switch from the current db to multiple dbs though a loop: $query = mysql_query("SELECT * FROM `linkedin` ORDER BY id", $CON ) or die( mysql_error() ); if( mysql_num_rows( $query ) != 0 ) { $last_update = time() / 60; while( $rows = mysql_fetch_array( $query ) ) { $contacts_db = "NNJN_" . $rows['e...

HTTP Status 403 - Access to the requested resource has been denied

I want to enable form based authentication by using database as realm but I'm always getting that message whenever I try to authenticate as Tomcat manager in Tomcat 6. I have already created a table user_name and user_roles and mapped the username(blue) to admin and manager as role in user_roles table in mysql, but I'm still unable to au...

Does Triggers in MySQL for Audit Log Slows Down The Main update Insert or delete process?

Does Triggers in MySQL for Audit Log Slows Down The Main update Insert or delete process? ...

Crash trying to migrate MySQL DB to SQL Server w/SQL Server Import Export Wizard

I'm trying to migrate a MySQL DB to SQL Server using MS's SQL Server Import Export Wizard. It isn't going so well... The wizard either tells me that the MySQL syntax is invalid or crashes depending on its mood. Here is the query that it executes against MySQL before failing: select * from "_account" Anyway to change so either MySQL l...

I'm looking for a constraint to prevent the insert of an empty string in MySQL

Ok, in this question I learned how to prevent the insert of a NULL value. But, unfortunately, an empty string is being inserted anyway. Apart from preventing this on the PHP side, I'd like to use something like a database constraint to prevent this. Of course a check on the application side is necessary, but I'd like it to be on both sid...

store Current Date & time in MySql Using ASP.net

I want to store the current date & time which can be get by System.DateTime.Now in asp.net but while storing in Mysql it gives Error of Invalid Time. ...

MySql select by column value. Separeta operator for columns.

Hi all, i have a mysql table like this +-----+---------+-----------+-----------------+-------+ | id | item_id | item_type | field_name | data | +-----+---------+-----------+-----------------+-------+ | 258 | 54 | page | field_interests | 1 | | 257 | 54 | page | field_interests | 0 | | 256 | 54 |...

How to search multiple columns in MySQL?

I'm trying to make a search feature that will search multiple columns to find a keyword based match. This query: SELECT title FROM pages LIKE %$query%; works only for searching one column, I noticed separating column names with commas results in an error. So is it possible to search multiple columns in mysql? ...

how to calculate a bill from several tables on mysql?

I'm using mysql to create an hotel booking system, but i am struggling a little bit to calculate the final bill. I need a SELECT command to get data from several tables and make some calculations. Basically I just need to get the 'night cost' from a table called 'room_types'. Then, use DATEDIFF function to get the difference of days be...

MySQL & PHP - Creating Multiple Parent Child Relations

Hi, I'm trying to build a navigation system using categories table with hierarchies. Normally, the table would be defined as follows: id (int) - Primary key name (varchar) - Name of the Category parentid (int) - Parent ID of this Category referenced to same table (Self Join) But the catch is that I require that a category can be child...

Count the number of fields that are not empty in MySQL

I have a database of users where they can send messages to other users (up to four) and the ID of the message they sent is in their user row. Name | Email | Msg1 | Msg2 | Msg3 | Msg4 --------+-------------+------+------+------+----- Pez | [email protected] | 1 | 55 | 42 | 5 Steve | [email protected] | 0 | 0 | 0 | 0...

How to get the value of a field in PHP?

I need to get the value of a field; I think I am along the right lines but not quite sure this is the proper code. The "Delete Movie" button is where I am trying to get the value of that row like so: value="'.$row['id'].'" Can you help? <?php //connect to database mysql_connect($mysql_hostname,$mysql_user,$mysql_password); @mysql...

Is there any possibility of changing the MySQL DB table's field name or adding a new field in Joomla in any project?

Is there any possibility of changing the MySQL DB table's field name or adding a new field in Joomla in any project? I need this information because I have to apply the Triggers for the tables.. Please Help ...