2 databases in one page
Is it possible to make a connection from one domain for example mysite.com to 2 different databases in two different locations (mysite.com and mysite2.com).
I'm using mysql 5.0 with PHP 5.x and my problem is:
I don't fully understand how they treat indexes.
I am familiar with PROGRESS databases, as that is what I work with, and having read through the mySQL manual, I have a couple of questions:
1. Comparing dates with > or < operators.
If I have an index:
and build my WHERE clause as "col_1_text = 'a' AND col_2_date > some_date AND col_2_date < some_date AND col_3_other = other"
will it use the index entirely, or only up to a certain point?
The reason I ask is, PROGRESS DB's stop after comparing a date using a > or < operator. As a workaround, we use a date driver in the code so that we run multiple queries:
"col_1_text = 'a' AND col_2_date = some_date AND col_3_other = other"
then increment some_date and run it again.
2. Would the "date driver" method be faster in any way?
If anyone knows any more (good) literature on mySQL indexes, please direct me, as the actual manual was somewhat sketchy, and most online searches give me general data on how to use indices (indexes...watever)
Yes, and assuming your using php, it would look something like this:
$conn1 = mysql_connect("mysite1.com", "123", "123");
$conn2 = mysql_connect("mysite2.com", "123", "123");
mysql_query("select * from mytable1", $conn1);
mysql_query("select * from mytable1", $conn2);
Browser :: FireFox 1.5
Resolution :: 1152x864
Connection :: Cable Modem 2Mbs
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)