tags:

views:

53

answers:

2

curl_setopt($ch, CURLOPT_FILE, $fp) which is used for output to a file. Is any way to set

output to database.

+4  A: 

No - send the output to a variable, and then insert the data in the variable to a database using mysql_query.

In general, inserting data into a database is a lot more complex than inserting data to a file (how do you connect to the database? what sort of database? what table? what column? update or insert? etc).

Dominic Rodger
+1 @Dominic Rodger - I just needed to post that.
karim79
+4  A: 

Yes there is. You will need to capture the output of the request as a string:

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

and write code to store it in the database :)

karim79
+1ed - For a moment there I thought you were saying something different - funny how we say much the same thing but you answer the question "Yes", and I said "No"!
Dominic Rodger