[PHP] Re: PHP 4.4.0RC1
I've tested it under solaris 9 and it failed 3 tests: = FAILED TEST SUMMARY - Bug #31213 (Sideeffects caused by bug #29493) [ext/standard/tests/array/bug31213.phpt] Bug #25665 (var_dump () hangs on Nan and INF) [ext/standard/tests/math/bug25665.phpt] Bug #27780 (strtotime(+1 xxx) returns a wrong date/time) [ext/standard/tests/time/bug27780.phpt] = = TEST RESULT SUMMARY - Exts skipped: 78 Exts tested :9 - Number of tests : 629 Tests skipped : 284 (45.2%) Tests warned:0 (0.0%) Tests failed:3 (0.5%) Tests passed: 342 (54.4%) - Time taken : 38 seconds = Nuno P.S.: the 'make test' didn't submit the report properly (at least i couldnt find it in the news server) Derick Rethans [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello! The PHP Team just released it's first release candidate for PHP 4.4.0. This is solely a bug-fix only release, the increased middle digit is needed because this release changes PHP's Internal API that causes third-party binary extensions to be incompatible with PHP 4.3.x. This release address a major problem within PHP concerning references. If references where used in a wrong way, PHP would often create memory corruptions which would not always surface and be visible. In other cases it can cause variables and objects to change type or class. If you encountered strange behavior like this, this release might fix it. Besides addressing this reference related bug, 46 other bugs are fixed. Please test this release and report any bugs or problems in our bugsystem (after searching first). If all goes well I plan to roll a release of 4.4.0 on June 27th. If there are problems a new RC will follow. Only critical bugs are going to be fixed between RC1 and RC2. You can find 4.4.0 RC1 at http://qa.php.net/~derick/php-4.4.0RC1.tar.bz2 regards, Derick -- Derick Rethans http://derickrethans.nl | http://ez.no | http://xdebug.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sscanf error?
Hello, I'm trying to use sscanf, but I'm not receiving the results I expected! Can anybody help me, please? Thanking in advance, Nuno Lopes // ? $db='33996344,33996351,GB,GBR,UNITED KINGDOM 50331648,83886079,US,USA,UNITED STATES 94585424,94585439,SE,SWE,SWEDEN'; $lines=explode(\n, $db); foreach ($lines as $line) { $array=sscanf($line, \%010d\,\%010d\,\%2s); list ($start, $end, $country) = $array; print_r($array); } ? /**/ Output: Array ( [0] = 33996344 [1] = 33996351 [2] = GB ) // Expected output: Array ( [0] = 0033996344 [1] = 0033996351 [2] = GB ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: sscanf error?
Hello, Thanks for your answer! You say that sscanf is doing it's job, so the documentation isn't very clear. I think it says that the format is equal to sprintf. And sprintf has %010d in format that says that a var is a number with at least 10 digits, filled with 0's. So I think that sscanf should do the job! Nuno Lopes - Original Message - From: Catalin Trifu [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, September 07, 2003 5:51 PM Subject: [PHP] Re: sscanf error? Hi, sscanf does what it says, that is it reads parameters, which means it expects to find a string like this 33996344 and converts it into an integer; that's why you get the result you get. This code does the job, but it's ugly: :). ?php $db='33996344,33996351,GB,GBR,UNITED KINGDOM 50331648,83886079,US,USA,UNITED STATES 94585424,94585439,SE,SWE,SWEDEN'; $lines=explode(\n, $db); echo pre; print_r($lines); foreach ($lines as $line) { $args = explode(,, $line); $array = sprintf(%010d,%010d,%2s, $args[0], $args[1], $args[2]); $array = explode(,, $array); list ($start, $end, $country) = $array; print_r($array); } print_r(printf(%010d, 33996344)); echo /pre; ? It uses sprintf. Cheers, Catalin Nuno Lopes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I'm trying to use sscanf, but I'm not receiving the results I expected! Can anybody help me, please? Thanking in advance, Nuno Lopes // ? $db='33996344,33996351,GB,GBR,UNITED KINGDOM 50331648,83886079,US,USA,UNITED STATES 94585424,94585439,SE,SWE,SWEDEN'; $lines=explode(\n, $db); foreach ($lines as $line) { $array=sscanf($line, \%010d\,\%010d\,\%2s); list ($start, $end, $country) = $array; print_r($array); } ? /**/ Output: Array ( [0] = 33996344 [1] = 33996351 [2] = GB ) // Expected output: Array ( [0] = 0033996344 [1] = 0033996351 [2] = GB ) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP and MySQL bug
@mysql_select_db(be); // this doesn't fail, because only the second (UPDATE) query fails. The first query (SELECT) is done! - Original Message - From: Marek Kilimajer [EMAIL PROTECTED] To: Nuno Lopes [EMAIL PROTECTED] Cc: MySQL List [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, January 07, 2003 5:06 PM Subject: Re: [PHP] Re: PHP and MySQL bug @mysql_select_db(be); -- this failed do echo mysql_error(); to see what went wrong Nuno Lopes wrote: I done a echo of Mysql_error and it returned: 'Nenhum banco de dados foi selecionado' (I have the mysql server in portuguese, but the translation is something like 'no db was selected') - Original Message - From: David Freeman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 05, 2003 10:29 PM Subject: RE: [PHP] Re: PHP and MySQL bug @MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this query doesn't work Personally, I'd call it bad programming practice to do a database update and not check to see if it worked or not. In this case, how are you determining that the query did not work? Are you manually checking the database? You don't have anything in your code to check the status of this query. Perhaps this might get you somewhere: $qid = @mysql_query(UPDATE d SET h = '$h' WHERE id = '$id'); if (isset($qid) mysql_affected_rows() == 1) { echo query executed; } else { echo query failed: . mysql_error(); } At least this way you might get some indication of where the problem is. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP and MySQL bug
Doesn't you have any simpler answer?? Maybe installing the new version of mysql server - I have version 3.23.49 - should do the trick - Original Message - From: Larry Brown [EMAIL PROTECTED] To: Nuno Lopes [EMAIL PROTECTED]; MySQL List [EMAIL PROTECTED] Sent: Tuesday, January 07, 2003 4:12 PM Subject: RE: [PHP] Re: PHP and MySQL bug Since nobody is jumping in to say it is some simple configuration/setting personally my next step would be to shut down all services on the box that aren't absolutely necessary and stop everything in the registry under run and stop anything in the start folder of the start menu and run the same tests. If no positive results I would uninstall php completely and clean any reference in the registry of it and then install with everything still shut down. Retest, if no progress do the same with mysql. These are radical and time-consuming methods, but it seems as though it is broken. If you absolutely need this fixed fast you might resort to paying the developers to give you a solution, although it may end up being what I just listed, or it could be some simple fix that we aren't aware of. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Nuno Lopes [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 07, 2003 4:31 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: [PHP] Re: PHP and MySQL bug I have the latest version of PHP (4.3.0) as module in apache 2.0.43 and mysql 3.23.49. Everything is working fine, except this. With pconnect the error is the same! - Original Message - From: Larry Brown [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Monday, January 06, 2003 6:28 PM Subject: RE: [PHP] Re: PHP and MySQL bug This definitely sounds like a buggy installation or there may be some problem with the communication between the web server and the mysqld. Is the db on a different machine? Try using mysql_pconnect instead of connect just to see what result you get. I have read some unfavorable statements about using pconnect with a large number of hits so if it works you should read the comments about it on php.net. Do a search for mysql_pconnect. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Nuno Lopes [mailto:[EMAIL PROTECTED]] Sent: Monday, January 06, 2003 1:09 PM To: MySQL List; [EMAIL PROTECTED] Subject: [PHP] Re: PHP and MySQL bug The problem is if I close the connection and reopen it the query is done, but if I remain with the same connection has the previous query, mysql returns an error. - Original Message - From: Larry Brown [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Sunday, January 05, 2003 4:16 PM Subject: Re:PHP and MySQL bug Try replacing the following line... @MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this query doesn't work With... $query = UPDATE d SET h='$h' WERE id='$id'; $queryr = mysql_query($query) or die(The sql statement does not execute); if(mysql_affected_rows() !== 1) { die(The sql statement is successfully run however either h did not change or there is an internal error. Try executing the sql from the command line to make sure it otherwise works.); } and see which is coming back. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] progress page
open pop window: head script language=JavaScript !-- setup='toolbar=no,location=no,directories=no,status=no,menubar=no,width=200, height=150,scrollbars=no,resizable=no' pop = window.open (,pop,setup) pop.document.write('headTitlePop Up/Title/headbody'); pop.document.write('centerPlease wait while this page loads./center'); -- /script /head close it: javascript:pop.window.close() - Original Message - From: - Edwin [EMAIL PROTECTED] To: Edward Peloke [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Monday, January 06, 2003 4:40 PM Subject: Re: [PHP] progress page Hello, [EMAIL PROTECTED] (Edward Peloke) wrote: I am working on an application that will take data from the user and run then check through all the data to find matches. Instead of the user seeing a blank screen while the page is loading, I would like to pop up a page that says, processing, please wait and maybe have an icon like a progress bar or something. How do I pop up a page and have it disappear when the the other page is done loading? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP and MySQL bug
I have the latest version of PHP (4.3.0) as module in apache 2.0.43 and mysql 3.23.49. Everything is working fine, except this. With pconnect the error is the same! - Original Message - From: Larry Brown [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Monday, January 06, 2003 6:28 PM Subject: RE: [PHP] Re: PHP and MySQL bug This definitely sounds like a buggy installation or there may be some problem with the communication between the web server and the mysqld. Is the db on a different machine? Try using mysql_pconnect instead of connect just to see what result you get. I have read some unfavorable statements about using pconnect with a large number of hits so if it works you should read the comments about it on php.net. Do a search for mysql_pconnect. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Nuno Lopes [mailto:[EMAIL PROTECTED]] Sent: Monday, January 06, 2003 1:09 PM To: MySQL List; [EMAIL PROTECTED] Subject: [PHP] Re: PHP and MySQL bug The problem is if I close the connection and reopen it the query is done, but if I remain with the same connection has the previous query, mysql returns an error. - Original Message - From: Larry Brown [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Sunday, January 05, 2003 4:16 PM Subject: Re:PHP and MySQL bug Try replacing the following line... @MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this query doesn't work With... $query = UPDATE d SET h='$h' WERE id='$id'; $queryr = mysql_query($query) or die(The sql statement does not execute); if(mysql_affected_rows() !== 1) { die(The sql statement is successfully run however either h did not change or there is an internal error. Try executing the sql from the command line to make sure it otherwise works.); } and see which is coming back. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP and MySQL bug
I'm using Windows 2000. - Original Message - From: Cleber [EMAIL PROTECTED] To: Nuno Lopes [EMAIL PROTECTED] Sent: Tuesday, January 07, 2003 10:23 AM Subject: Re: [PHP] Re: PHP and MySQL bug Try add to /etc/hosts the name and ip of DB is located - Original Message - From: Nuno Lopes [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Tuesday, January 07, 2003 7:31 AM Subject: Re: [PHP] Re: PHP and MySQL bug I have the latest version of PHP (4.3.0) as module in apache 2.0.43 and mysql 3.23.49. Everything is working fine, except this. With pconnect the error is the same! - Original Message - From: Larry Brown [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Monday, January 06, 2003 6:28 PM Subject: RE: [PHP] Re: PHP and MySQL bug This definitely sounds like a buggy installation or there may be some problem with the communication between the web server and the mysqld. Is the db on a different machine? Try using mysql_pconnect instead of connect just to see what result you get. I have read some unfavorable statements about using pconnect with a large number of hits so if it works you should read the comments about it on php.net. Do a search for mysql_pconnect. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -Original Message- From: Nuno Lopes [mailto:[EMAIL PROTECTED]] Sent: Monday, January 06, 2003 1:09 PM To: MySQL List; [EMAIL PROTECTED] Subject: [PHP] Re: PHP and MySQL bug The problem is if I close the connection and reopen it the query is done, but if I remain with the same connection has the previous query, mysql returns an error. - Original Message - From: Larry Brown [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Sunday, January 05, 2003 4:16 PM Subject: Re:PHP and MySQL bug Try replacing the following line... @MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this query doesn't work With... $query = UPDATE d SET h='$h' WERE id='$id'; $queryr = mysql_query($query) or die(The sql statement does not execute); if(mysql_affected_rows() !== 1) { die(The sql statement is successfully run however either h did not change or there is an internal error. Try executing the sql from the command line to make sure it otherwise works.); } and see which is coming back. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP and MySQL bug
I done a echo of Mysql_error and it returned: 'Nenhum banco de dados foi selecionado' (I have the mysql server in portuguese, but the translation is something like 'no db was selected') - Original Message - From: David Freeman [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 05, 2003 10:29 PM Subject: RE: [PHP] Re: PHP and MySQL bug @MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this query doesn't work Personally, I'd call it bad programming practice to do a database update and not check to see if it worked or not. In this case, how are you determining that the query did not work? Are you manually checking the database? You don't have anything in your code to check the status of this query. Perhaps this might get you somewhere: $qid = @mysql_query(UPDATE d SET h = '$h' WHERE id = '$id'); if (isset($qid) mysql_affected_rows() == 1) { echo query executed; } else { echo query failed: . mysql_error(); } At least this way you might get some indication of where the problem is. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP and MySQL bug
The problem is if I close the connection and reopen it the query is done, but if I remain with the same connection has the previous query, mysql returns an error. - Original Message - From: Larry Brown [EMAIL PROTECTED] To: MySQL List [EMAIL PROTECTED] Sent: Sunday, January 05, 2003 4:16 PM Subject: Re:PHP and MySQL bug Try replacing the following line... @MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this query doesn't work With... $query = UPDATE d SET h='$h' WERE id='$id'; $queryr = mysql_query($query) or die(The sql statement does not execute); if(mysql_affected_rows() !== 1) { die(The sql statement is successfully run however either h did not change or there is an internal error. Try executing the sql from the command line to make sure it otherwise works.); } and see which is coming back. Larry S. Brown Dimension Networks, Inc. (727) 723-8388 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP and MySQL bug
Here is the source code: ? @MYSQL_CONNECT(localhost, nlopes, testing) or die(Erro 1); @mysql_select_db(be); $r=MYSQL_QUERY(SELECT n,u,m,h FROM d WHERE id='$id'); if (mysql_num_rows($r)==0) { die (Erro); } else { $re=mysql_fetch_array($r, MYSQL_NUM); $nome=$re[0]; $url=$re[1]; $mirrors=$re[2]; $h=$re[3]; $h++; @MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); // this query doesn't work echo h2Seleccione a localização para o download:/h2pa href=\$url\Localização Principal/a/p; if ($mirrors) { echo pnbsp;/ph2Mirrors/h2p; $m=explode(»,$mirrors); foreach ($m as $v) { $m2=explode(!,$v); echo a href=\$m2[1]\$m2[0]/abr; } echo /ppNota: Deve escolher o mirror mais próximo da sua localização, para acelerar o dowload. No caso de um mirror estar indisponível, utilize outro./p; } } @MYSQL_CLOSE(); ?/body/html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and MySQL bug
Dear Sirs, I'm using PHP and MySQL to make my programs. But I think I discovered a bug in PHP or in MySQL (I don't know!). In one of my files I have the following: MYSQL_CONNECT(localhost, **user**, **pass**); mysql_select_db(be); $r=MYSQL_QUERY(SELECT n,u,m,h FROM d WHERE id='$id'); /* Some code including mysql_num_rows and mysql_fetch_array($r, MYSQL_NUM) And the another query: */ MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); /* i don't know why but this doesn't work! But if I close the connection and open another te query is done:*/ MYSQL_CLOSE(); MYSQL_CONNECT(localhost, **user**, **pass**); mysql_select_db(be); MYSQL_QUERY(UPDATE d SET h='$h' WHERE id='$id'); --- I don't know why is this? Because I'm used to do more than a query per connection and this never happened! I'm using Win 2k, Apache 2.0.43, MySQL 3.23.49-nt and PHP 4.3. I hope you solve this, Nuno Lopes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php