I am moving data from a MSSQL database to a MySQL database. I need to connect with PHP to MSSQL and then insert into MySQL. Could someone tell me how to:
See if the mssql server is running remotely,
How to connect to it?
Code:
mssql_connect($host,$user,$pass) or die('Failed Server Connect! ' . mssql_get_last_message());
mssql_selec...
I have been working on a cURL script and I am finally done, yay! Basically, right now, I am grabbing the error / success message and storing it, but how should I store it? Should I store it in a .txt file or MySQL. What is a efficient/common practice?
EDIT:
I already have a MySQL database. I do not mind taking a little more time. After...
I want to access a MySQL database and I want to read+write data from+to the database within my Qt/C++ program. For the read write process, I try to use QSqlTableModel, QSqlTableRcord and QSqlDatabase as this is a very pleasant approach without too much of SQL commands which I dislike for the one or other reason (to handle myself).
I got ...
SELECT user_id, created FROM photo_comments GROUP BY user_id
returns
user_id created
1 2009-10-20 21:08:22
12 2009-10-20 21:45:00
16 2009-10-28 20:35:30
But that created date of 2009-10-20 for user id 1 is the first entry by user id 1.
How can I get the last entry by user id 1? (date should be 2009...
I'm trying to create an SQL query to work out the percentage of rows given its number of play counts.
My DB currently has 800 rows of content,
All content has been played a total of 3,000,000 times put together
table:
*id, play_count, content*
Lets say I'd like to work out the percentage of the first 10 rows.
My attempts have looked ...
I'm building an index of data, which will entail storing lots of triplets in the form (document, term, weight). I will be storing up to a few million such rows. Currently I'm doing this in MySQL as a simple table. I'm storing the document and term identifiers as string values than foreign keys to other tables. I'm re-writing the software...
I'm trying to get the $url value to display from the MySQL database but I can only get the $cat value to display correctly can someone please help me learn how to display the $url value.
I now I'm doing something wrong.
Here is the partial code.
// Loop through each subarray:
foreach ($parent as $id => $cat) {
// Display the item:
...
I'm a beginner and trying to generate as much of my own code as possible without just constantly asking others to write it for me, so with regard to this question I'm looking for hints in the right direction, rather than outright working examples. You people are all very talented, but I learn best if I reason it out myself. Should I hit ...
Howdy,
I'd like to select out of one table all the entries that match two criteria
SELECT * WHERE field1 IS $a AND field2 IS $b FROM TablaA
something like that ...
...
What is the best way to export data from multiple tables in MySQL. I'm basically working with product details. Say a product has 150 attributes of data. How can I export that in a single row and then export it to a flat file in CSV or tabdelimited format.
Getting error Too many tables; MySQL can only use 61 tables in a join
/**** Get ...
I just wanted a little bit of information on MYSQLI_NUM. And is it part of PHP or MySQL.
...
Ok I believe this must be a pretty common scenario. I need to send a NSData variable over a HTTP request through a PHP page which then subsequently stores it in MySQL. This will be retrieved later by some other HTTP call which then downloads it into a NSData again. What is the best way to do this?
Should I convert the NSData into some s...
Hello,
SQL beginner here !
What is the most convenient way to create datetime objects within an SQL function, especially generating a datetime object for a given day, month, and year?
Thanks !
...
Query table articles:
select * from articles where article_id in(98,97,96,99)
returned result ordered like
record 96 ...
record 97 ...
record 98 ...
record 99 ...
but I prefer the result ordered the same as 'in(98,97,96,99)'. Any tricks to make it possible?
Thanks.
...
Hi,
I have a table generated by GORM (Grails Domain). It has foreign key / index that generated random characters like FKAC7AAF67162A158F. I need to remove that field that not needed anymore.
The problems, I have some servers that need to be updated. So I need to create a migration using Liquibase. But I have no idea how to remove that...
I normally code on windows and using MYSQL4.1. And mysql gem version is 2.8.1. In my setup when I use mysql gem to access the MYSQL server, I give the root username and password of the sql server. And in rails db config file, I give user name as 'root' and its password and host as 'localhost'. My rails server and Mysql server are running...
I have a table, which regularly is inserted with new data.
I need to get the very last ID of the table.
How can I do this?
Is it similar to: SELECT MAX(id) FROM table ?
...
Hi,
I have this table:
CREATE TABLE `test` (
`ID` int(11) NOT NULL auto_increment,
`text` varchar(250) collate utf8_unicode_ci default NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
Content:
ID text
1 70-and-some-text
70 blub
Then I make execute...
I'm writing a query to get ALL of the products in the products table, and the sale price for each product IF a record exists for that item in the specials table.
What I'm looking for is something like:
SELECT * FROM products P
IF (S.specials_date_available <= NOW() AND S.expires_date > NOW())
{ // The sale has started, but has not yet ...
How do I change the amount auto_increment fields in MySQL increment by from the default (1) to n?
...