I've looked through all the related questions, but none of them does exactly what I need. I have two identically-structured tables (id, VoucherNbr, BalanceInit) - one is from our current production system (tableA), and the other is from a client's legacy system (tableB). Table A has records a,b,c,d,e (for example), and table B has a,b,c,...
I'm tuning my query for mysql.
the schema has index of user_id (following..)
but the index is not used. why?
Env:
MySQL4.0.27,MyISAM
SQL is the following :
SELECT type,SUM(value_a) A, SUM(value_b) B, SUM(value_c) C
FROM big_record_table
WHERE user_id='<user_id>'
GROUP BY type
Explain:
|table |type |possible_keys |key |key_len...
I've set up a simple gallery system in PHP that is built to display one image per page. My URL parameter simply uses a gallery variable and a page variable and does not use the image iD in any way to pull the image. This is because I'm setting my htaccess settings to make a friendly URL:
http://mysite.com/images/1/
^ Would pull the ...
I have an existing database with a users table and questions/answers table. I'd like to use bbpress (or any forum really) as a front end for this for access via the web. Is this possible? Has anyone done this?
Look forward to the responses. Thanks!
...
I am making a synonyms list that I will store it in database and retrieve it before doing full text search.
When users enters like: word1
I need to lookup for this word in my synonyms table. So if the word is found, I would SELECT all the synonyms of this word and use it in the fulltext search on the next query where I contruct the que...
I have a program that does a limited form of multithreading. It is written in Delphi, and uses libmysql.dll (the C API) to access a MySQL server. The program must process a long list of records, taking ~0.1s per record. Think of it as one big loop. All database access is done by worker threads which either prefetch the next records o...
Hi all,
i want migrate a database from Sql Server 2008 to MySql using a the tool MySql Migration Toolkit but when the tool is establishing the database connection i receive this error :
Connecting to source database and retrieve schemata names.
Initializing JDBC driver ...
Driver class MS SQL JDBC Driver
Opening connection ...
Connec...
Hello there,
How to make query in sql to delete all record exist in every table.
There possible to write every name table using command delete. But it will take long time to write every single name table.
I am already try DELETE FROM * in MySQL but it got error:
You have an error in your SQL syntax; check the manual that correspond...
Looking for a php login script. I've searched stackoverflow and have seen a lot of posts, but can anyone recommend the best method? Also, If I want to use hashing, how do you decode the password when retrieving? My iPhone app uses the same database and currently the passwords are stored in normal text (not very secure, I know).
Also, if...
What I want to do is add a number to the beginning of the file name so I don't have a duplicate file name in the folder.
So I choose my file "example.pdf" and upload, I got the the part of the code that looks like this:
move_uploaded_file($HTTP_POST_FILES['ufile']['tmp_name'][0], $path1);
In this line of code above can I add a variab...
I'm curious to know, "what if I delete information_schema database from mySQL?"
...
An import was performed on my database which wasn't done so well. It's resulted in some fields being empty where they shoudln't, etc...
What I need to do now is move all the data from one column in one table into a column in a different table. Both tables have an ID which is a link to each rows.
For example:
Table1
id | linkID | emai...
i have a form, that consist of:
<input type="text" id="model">
<input type="text" id="serial">
<input type="text" id="lot_no">
<select id="line">
beside that i have data in settingdata table:
Model Serial Lot_no Line
abc 0001 012a 1
abc 0101 022a 1
i want if i type abc in #model ...
Hi, Im trying to do a search engine. However, im facing this errors.. Anyone can help..
Error :
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\i-document\search_admin.php on line 90
Thankz in advance.
Php Code :
<?php
//Get data
$button = isset($_GET['submit']) ? $_GET['submit'] : ''...
Hi ,
How to retrieve the records those character star starting with A OR B OR C ,
I just tried this query
SELECT * FROM `test_tbl` WHERE Left(cus_name, 1) = 'a'
---> display all customer name starting with character a
AND i added one more condition, That is
SELECT * FROM `test_tbl` WHERE Left(cus_name, 1) = 'a' or Left(cus_name...
I use following code
$this->getDb()->fetchRow($sql, $params);
Is it free from sql injection? Please guide me. How i can make it free from sql injection.
...
Hello,
I am working with a database that has a table called date, which contains a separate field for day, month, year. Clearly this is not ideal when I am trying to run comparisons, etc. I am wondering is it possible for me to add a DateTime field to each row of this table and insert a concatenated string into the new field from the ex...
I need some help writing a MySQL query that grabs the mode (most frequently occurring number) each day
Data set looks something like this
datetime number
2010-01-01 00:35:00 500
2010-01-01 01:15:10 500
2010-01-02 01:25:10 1500
2010-01-02 01:35:10 50
2010-01-03 12:35:50 100
2010-01-05 05:25:10 2500
(etc)
...
hi, there is a Q about MySQL
When i use this:
SELECT DISTINCT id FROM table
this works! but... when i want to filter only one column i try to do this:
SELECT DISTINCT prod_id, id, prod_picture FROM products
this gives me all table... i just need 1 picture for each product, like:
1 | 1 | asd.jpg
2 | 3 | weq.jph
not
1 | 1 | asd.j...
Occasionally we're seeing an error from ASP pages:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[MySQL][MyODBC 5.00.11][MySQL] 2006 MySQL server has gone away
We're handling it the best way we can in ASP but it still crops up. I think it's more to do with the MySQL ODBC driver than the ASP code. We never see this with ...