Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 07-31-2008, 09:45 PM MySQLi & cURL
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
So, I've spent the last 3 days trying to hunt down a bug amongst 1000's of lines of code. Comes down to this: I have an instance of MySQLi which is created when the script first runs. It performs lots of calculations and then gets to a cURL call. The cURL call takes > 60 seconds to run and the MySQLi connection "goes away" (MySQL message). There are dozens of cURL calls and 100's of queries. This is a product which is installed on a variety of servers.

What would you do?

I've been thinking about:

1) Each time after a cURL call is made, check for the connection and re-establish it if it's there. This requires me to execute a SELECT 1+1 query to see that the server connection is gone and that seems a bit much to me to do dozens of times per script run.

2) Each time a query is done, I could do the same check, but that gives a worse problem.

I'm clueless, so any advice is very much appreciated.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
 
Register now for full access!
Old 08-01-2008, 07:59 PM Re: MySQLi & cURL
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
Don't you know by now that this is the "PHP for Dummies" forum? You asked a "PHP for Smarties" question...
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 08-01-2008, 08:08 PM Re: MySQLi & cURL
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
LOL! I decided to provide an option for the user to set a cURL timeout. Then, they can figure it out for themselves and make it short enough to ensure the query is executed when posting to slow servers.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to MySQLi & cURL
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27484 seconds with 12 queries