Hello,
I need to join two tables from different MySQL (PHP) connection strings and different databases.
$conn = mysql_connect('192.168.30.20', 'user', 'pass');
$conn2 = mysql_connect('anotherIPHere', 'user2', 'pass2');
$db = mysql_select_db('1stdb', $conn);
$db2 = mysql_select_db('2nddb', $conn2);
If I were using the same connecti...
i have a legacy Java system that every time it gets an order it makes a JDBC call to a stored procedure for each field in the order. Generally the stored procedure will get called 20 to 30 times for each order. The store procedure is just doing an insert into a table for each field.
i need to improve the performance of this operat...
Was just wondering if there was any software out there to do this? The storage engine is InnoDB so the foreign keys are in place to connect the tables up in the diagram (if such software even exists).
...
Hi,
I need a query to perform the following:
find the countryID where country = 'UK' from table Countries
then use the found value in
INSERT into towns (id, country_fk, name)
values (1, <value_found>, 'London').
is this possible?
UPDATE I need to store the value once so that I can use it in multiple INSERTS (about 100)
...
I have read this article from High Scalability about Stack Overflow and other large websites. Many large high traffic .NET sites such as plentyoffish.com, MySpace and Stack Overflow all use .NET technologies and use SQL Server for their database. In the article it says a source in Stack Overflow said:
As you add more and more databas...
Hy!
Here is my problem: i have a profile and this profile has for example 100 images.
When someone visit this profile the first image will be the first result of my query that sorts by updated_at.
But if the user would want to put the image with the (id = 8) to be the first, then (id = 22) then (id = 88) and so on?
I need to put ano...
For some reason I can't pass a var inside a mysql statement. I have a function that can be used for multiple tables. So instead of repeating the code I want to change the table that is selected from like so,
function show_all_records($table_name) {
mysql_query("SELECT * FROM $table_name");
etc, etc...
}
And to call the functio...
How can I select the contents of two columns that reside in different tables in a mysql database?
...
Does mysql provide a mechanism for storing and retrieving encrypted data? I don't mean passwords, I mean real strings.
I'd like to encrypt a string, store in mysql and then retrieve the decrypted string at a later date.
So, I know there is the AES_Encrypt and decrypt functions. But they ask for a key. (which is fine) but I wondering i...
This is my stored procedure to search throgh all databases,tables and columns.
This procedure got created with out any error.
DELIMITER $$
DROP PROCEDURE IF EXISTS `mydb`.`get_table`$$
CREATE DEFINER=`root`@`%` PROCEDURE `get_table`(in_search varchar(50))
READS SQL DATA
BEGIN
DECLARE trunc_cmd VARCHAR(50);
DECLARE search_string VA...
I'm getting the following error when trying to connect to a remote mysql server.
Request for the permission of type 'System.Data.Odbc.OdbcPermission,
System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' failed.
I've installed the odbc 5.1 driver, and can connect to the database using the Data Sources (ODBC...
I heard a rumor that when inserting binary data (files and such) into MySQL, you should use the bin2hex() function and send it as a HEX-coded value, rather than just use mysql_real_escape_string on the binary string and use that.
// That you should do
$hex = bin2hex($raw_bin);
$sql = "INSERT INTO `table`(`file`) VALUES (X'{$hex}')";
//...
Hi
I need autoscaling of mysql-slave on ec2 can anybody guide me how to do that and how to transfer the load on newly added instance
...
Here is my data structure
when i try this sql
select rec_id, customer_id, dc_number, balance
from payments
where customer_id='IHS050018'
group by dc_number
order by rec_id desc;
something is wrong somewhere, idk
I need
rec_id customer_id dc_number balance
2 IHS050018 DC3 -1
3 IHS050018 52 ...
I have a table (innodb) that will have billions of records eventually. Every 2nd week I expect ~ 500K records to get dropped into the table. I would want to partition this table based on the date on which the data is imported - luckily this is a field in the table that is of the format yyyy-mm-dd - Is it possible to partition it based o...
I am storing a running total in a Decimal(10,2) field and adding to it as items are processed.
update foo set bar = bar + '3.15'
About 20% of the times a warning is issued "Data truncated for column 'bar' at row 4"
This warning is never issued if the update value is not quoted.
Should decimal values be quoted?
...
I have 2 mysql tables
1. questions: with the following columns: id, title, answer1, answer2, answer3, answer4, answer5, nranswers.
and
2. answers with the following columns: id, questionid, userid, answer
Every question has maximum 5 answers( it can have between 2 and 5 answers). My problem is that I want to select from my database...
Hey, I'm running WordPress, the database diagram could be found here: http://codex.wordpress.org/Database_Description
After doing tonnes of filters and applying some hooks to the core, I'm left with the following query:
SELECT SQL_CALC_FOUND_ROWS wp_posts.* FROM wp_posts
JOIN wp_postmeta ppmeta_beds ON (ppmeta_beds.post_id = wp_posts...
new_thing = MyTable(last_updated=datetime.datetime.now())
new_thing.save()
>>>>select * from MyTable\G;
last_updated: 2010-04-01 05:26:21
However, in my Python console...this is what it says...
>>> print datetime.datetime.now()
2010-04-01 10:26:21.643041
So obviously it's off by 5 hours.
By the way, the database uses "SYSTEM" as it...
Hello,
Updated below
I couldn't describe the question any better without going into detail.
I am having major issues with development/deployment of projects using SubSonic.
Up until now everything has been fine but this is seriously hampering my progress.
The project, while not important, is a CMS/Shopping Cart.
I am using
Visu...