Jump to content

Earthenware

Members
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Earthenware's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you for the replies. I'm quite surprised, as this is sure to have a significant impact. Reading the document that kicken linked, it's interesting to see the technical arguments but it seems that only Anthony Ferrara appreciates the impact that this is going to have (at least from the quotes given). My problem is now fixed so it won't affect me (thanks xylex, it was because of multiple sockets) but from a business perspective I feel very sorry for all the people out there who are going to be affected by this problem. They won't all be able to afford to hire someone to fix this for them and no, Jessica, they don't deserve to have their sites go down because of this.
  2. Hi, The php.net pages for mysql DB connection functions say “This extension is deprecated as of PHP 5.5.0, and will be removed in the future.” I thought that it would be good practice to move from mysql to mysqli so I updated my scripts. Everything works fine under low load conditions (i.e. no warning or error messages, performance seems fine) but under heavy load it starts to fall apart. I randomly get “Warning: mysqli::mysqli(): [2002] Only one usage of each socket address (protocol/network address/port) is normally permitted”. This seems to stop all DB interaction for the remaining execution of the script. The next script (immediately following) seems to have a random chance of encountering the same error. The random nature of the problem and the fact that my scripts work fine under low load make it difficult to determine the cause. I assume that my coding isn't the best and that mysql is in some way more fault-tolerant than mysqli. The easiest solution would be for me to just return to using the mysql connection functions. This made me wonder. How likely is it that the mysql connection functions would ever really be removed? There must be millions of scripts out there that use them and and the overhead of updating them all would be enormous – I would guess comparable to the amount of work preceding the millennium. If ISPs ever implemented a version of PHP that did not support mysql connection functions, they would be bombarded with support calls from people who operated sites using scripts that they had not themselves written and may not be able to re-write themselves. So, realistically, will mysql functions ever be removed from PHP? I reckon not, but it would be interesting to hear the opinions of people better informed than I. Thanks.
  3. This worked a treat, thanks. I hope I'm not breaking any forum rules, but I found this nice example of both send and receive scripts. http://www.maheshchari.com/upload-image-file-to-remote-server-with-php-curl/
  4. Hi, I'd be really grateful for some help with a problem that I am having transferring data to a server. My objective is simple – to transfer data from my laptop to a server using a local PHP script, no FTP clients, no browsers, no HTML forms and no exotic server software which may not be supported by all ISPs. I can't find a way to do it using POST and the consensus on the Web seems to be that this is deliberate, as to allow file upload without user interaction (i.e. no SUBMIT button) would be a security breach. I believe that I could do it using GET by constructing a URL that contains the data, but it looks like I would run into problems with max URL length which, depending who you read, could be anything from 2k to 8k depending on the server. I don't want to get into splitting and reassembling the data if I can avoid it. I've tried FTP_PUT but I can't seem to get around the “425 Can't open data connection” problem. The Filezilla forum just assigns the problem to “malicious” routers and firewalls. I don't want to get into the guts of FTP if avoidable. I can't help feeling that I am missing something. This is such a simple requirement. Would any kind person care to share their experience in dealing with such simple data transfers? Thanks.
  5. That worked. I've put... $rc = mysql_affected_rows(); ...below the code above and it returns the expected value, so I can script around that. Many thanks.
  6. That's my problem. I'm not getting any error. The output is the same whether the record exists or not.
  7. Hi, I have a feeling that this is an obvious one but I can’t seem to find an answer. I am trying to evaluate the result of an UPDATE query. My syntax works fine and my DB gets updated as expected. My problem is that if I put a non-existent value in my WHERE clause, I don’t get warned about it. I’m doing this: error_reporting(E_ALL); $query = "update <TABLE> set <FIELD1> = '<VALUE1>' where <FIELD2> = '<VALUE2>'"; $result = mysql_query ($query, $db) or die ("Query failed: " . mysql_error() . " Actual query: " . $query); The result is the same whether VALUE2 exists in the DB or not. $result is always returned as ‘1’. According to dev.mysql.com, “UPDATE returns the number of rows that were actually changed”, but I get ‘1’ whether a row was changed or not. My goal of course is to have the script notify me if the record that I am trying to update doesn’t exist. That is what is not happening at the moment.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.