mysql

Better way to download mysql table using C#?

I currently use the code below but its not uncommon for it to throw an "tried to read past the stream" error once the mysql table has reached over 20 thousand entries. MySqlConnection connection = new MySqlConnection(MyConString); MySqlCommand command = connection.CreateCommand(); connection.Open(); c...

What is the logic behind edit a primarykey feild

Hi, Consider my application helps us to create a collection with different pages and also each have different auto increment id's. I am storing the events of every pages in another mysql table 'events'. Here, pageid and collectionid are my foreign keys in events. My prblem is when we edit the collection details; these action help us to ...

MYSQL query doubt - storing selected value to variables

i am using a stored procedure. i declared 2 varaibles . shown below DECLARE pProductCode VARCHAR(15); DECLARE pProductVersion VARCHAR(30); i am selecting ProductCode and prodcuctVersion using a query from a table . shown below SELECT ProductCode, ProductVersion FROM packages WHERE PackageID = pPackag...

How do speed up data retrive from Mysql database

I am working with c# windows form application and using mysql as back end.i have a table employee ,in that i have more 2000 rows its just a example likely more record, when i retrieving and filtering the data from database my application getting slow, Is anyother way to retirve database in good speed, shall achieve the speed by using Lin...

how to fetch a mysql table and order it by date

hey guys in order to compelete my statistic script i need to show everyday visits so if i want to show today and yesterday visits i use this code : $timestamp = time(); $today = date("Y-m-d") ; $yesterday = date("Y-m-d", strtotime("-1 day")); $yesterday_1 = date("Y-m-d", strtotime("-2 day")); list($TotalVisitsTod...

How to run series of SQL statements stored in a .text file in PHP?

I store such sqls in a text file: insert into table ...; ... insert into table ...; How to executable all those statements with PHP? It seems mysql_query() can only execute 1 statement every time. UPDATE The reason I don't do it in command line like this mysql -u your_user_name -p -D your_database_name < your_sql_file.txt; is th...

How do i migrate data from MSSQL 2000 data tp MySQL?

Hi guys, I am given a task of developing a tool for migrating data from MSSQL 2000 do MySQL database. My clients runs a third party software which stores data in MSSQL 2000. The application is desktop software that stores data in local MSSQL Server. My Application is in web. We store data on online servers. Now my task is to write a ...

MySQL: how to prevent insertion of a row with all columns = NULL ?

In my MySQL table, every column by itself can be NULL, but there must be at least one column with a non-NULL value. At the moment, I am wrapping an insert statement in a stored procedure which prevents insertion of all-NULL rows, but that of course does not keep anyone from using native INSERT statements, circumventing my wrapper procedu...

sql and mysql combined query

Hi , i have tableA in sql database , and tableB in mysql database , How to write the join and which function should i use for that(myssql_query or mssql_query ) Thanks ...

How to query for strings based on their length

create table dict {id, word varchar2(255)). I store strings of varying lengths within the 'word' field. How do I query for the following cases:- Search all words which are 4 characters in length Search all words which are greater than 4 characters in length Search all words which have 4-8 characters (inclusive) Search all words which ...

how to prevent QTableModel from updating table depending on some condition

hello , i have a mysql tables that uses lock-write mechanism. the lock might go for too long (we're talking about 1-2 minutes here). i had to make a check if the table is in use or not before the update is done (using beforeUpdate signal) but after checking and returning that my table is in use , system hang until the other user unl...

cross table from two table in MySql

I have two tables, one parts_raised and another is parts_detail. parts_raised: SN(int),Job_Number(int),Category(varchar),Part_code(int),technician(varchar),Time (timestamp), Parts_detail: Part_code(int),Value(int),Descriptions(text), part_code is same in both table. How can i write query for achieving total count of jobs,and ...

Mysql turns ' into ’?

Hi guys, How can I stop mysql from converting ' into ’ when I do an insert? i believe it has something to do with charset or something? I am using php to do the mysql_insert. ...

PostgreSql + Searching Issue for "'" present in string

Here, I have a problem in searching record in Postgresql DB in RoR Application. Name of table :: address_books, name of attributes :: organization_name, federal_tax_id, city, zip , business_name. In search, organization name contain :: Claire's Inc as record. At the time of searching, it does not show the data while we select Claire's I...

How to have custom url for user uploaded files using php

How can i offer custom url's for files uploaded by users. For ex: user uploads a file called stack.png and it's uploaded on directory http://www.website.com/uploads/stack.png But i want to allow the user to view/download the same file at http://www.website.com/username/uploads/stack.png Please note i don't want to use url shortening/c...

Cannot connect to remote mysql through tomcat

Hi, I am able to connect to mysql through a gui workbench but when i try to connect with my applications datasource (which runs on tomcat) i get: Access denied for user 'dbuser'@'192.168.100.231' (using password: YES) i have tried all the options in the mysql reference guide but none worked. any ideas? ...

MySql stored procedures, delete record logically or phisically depending on existing table references

Hi, I have to write a Stored Procedure to delete record from a table. I have a memory table "tableids" where I store all the ids to delete from another table, say "addresses". CREATE TABLE `tempids` ( `id` INT(11) NULL DEFAULT NULL ) COLLATE='latin1_swedish_ci' ENGINE=MEMORY ROW_FORMAT=DEFAULT I could do this: DELETE FROM addr...

INNER JOIN DISTINCT with MySQL

I have a mysql problem. I have two tables like this that I need to join together. table: id otherid2 1 | 1 2 | 1 3 | 2 4 | 2 table2: otherid otherid2 1 | 1 2 | 1 3 | 2 4 | 2 I'm using: SELECT id,otherid FROM table INNER JOIN table2 ON table.otherid2=table2.otherid2 Th...

PHP or Perl - How to sync databases in one direction that contain tables that have an un-matching number of columns.

I recently had a challenge dropped in my lap. A site owners web guy moved on and he requested my assistance in figuring out how to sync his databases. Each database is on a separate server. I thought no problem, right. I launched naivicat, entered each servers credentials and verified the databases names, tables and all looked quite si...

can you have multiple "SQL Editor" tabs in SQL-Front mySQL gui

i am used to SQL Server and SQL enterprise studio when using databases in my solutions. I have to use mySQL so i have tried out SQL-Front gui which seems pretty good. The one missing thing that is a pain point is that i can't figure how to have multiple queries around at once. in SQL Server Enterprise manager, it would create a new ta...