ArK
ArK

Reputation: 21068

curl output to database

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

output to database.

Upvotes: 1

Views: 1304

Answers (2)

karim79
karim79

Reputation: 342665

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 :)

Upvotes: 4

Dominic Rodger
Dominic Rodger

Reputation: 99801

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).

Upvotes: 4

Related Questions