[PHP-DB] mysql_connect(): Lost connection to MySQL server during query

2008-08-12 Thread Manoj Singh
Hello all, I am getting this error when connecting to the database through mysql_connect function. Error: mysql_connect() [a href='function.mysql-connect'function.mysql-connect/a]: Lost connection to MySQL server during query I am getting this error when the db server has the high load. Please

Re: [PHP-DB] mysql_connect(): Lost connection to MySQL server during query

2008-08-12 Thread Evert Lammerts
http://dev.mysql.com/doc/refman/5.0/en/gone-away.html should get you started. Good luck! On Tue, Aug 12, 2008 at 8:27 AM, Manoj Singh [EMAIL PROTECTED] wrote: Hello all, I am getting this error when connecting to the database through mysql_connect function. Error: mysql_connect() [a

[PHP-DB] PHP Self pages

2008-08-12 Thread kitfox69
I have three PHP pages that post data to each consecutive page. I would like the second page, the one with a pull down menu of customer ids, to spawn itself onto the next page so that the person using it would not have to click back to choose the next customer id. Currently the first page

Re: [PHP-DB] PHP Self pages

2008-08-12 Thread Micah Gersten
Try this: http://xajaxproject.org/ Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com [EMAIL PROTECTED] wrote: I have three PHP pages that post data to each consecutive page. I would like the second page, the one with a pull down menu of customer ids, to

[PHP-DB] I want to remove the last comma

2008-08-12 Thread A. Joseph
This the script $dir = images; $d = opendir($dir); $out = var tinyMCEImageList = new Array(\n; while(false != ($entry = readdir($d))) { if(preg_match(/(.jpg|.gif|.png)$/, $entry) != false) { $out .= ['{$entry}', '{$dir}/{$entry}'],\n; } } $out .= );\n; This the out put var

Re: [PHP-DB] I want to remove the last comma

2008-08-12 Thread Micah Gersten
Create an Array in the loop and then join with ,\n. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com A. Joseph wrote: This the script $dir = images; $d = opendir($dir); $out = var tinyMCEImageList = new Array(\n; while(false != ($entry = readdir($d)))

Re: [PHP-DB] I want to remove the last comma

2008-08-12 Thread YVES SUCAET
$out = substr($out, 0, strlen($out) - 1); Removes the overhead cost of creating the array and then joining it. HTH, Yves -- Original Message -- Received: Tue, 12 Aug 2008 02:31:28 PM CDT From: Micah Gersten [EMAIL PROTECTED] To: A. Joseph [EMAIL PROTECTED]Cc: php-db@lists.php.net

Re: [PHP-DB] I want to remove the last comma

2008-08-12 Thread YVES SUCAET
Ah, I forgot the \n newline character you're adding as well. That would require you to chop off two character instead of one :-) Here's the adjusted script: snip $dir = images; $d = opendir($dir); $out = var tinyMCEImageList = new Array(\n; while(false != ($entry = readdir($d))) {

Re: [PHP-DB] I want to remove the last comma

2008-08-12 Thread Dee Ayy
What I would do is change var tinyMCEImageList = new Array(\n; to have a space and then the newline character at the end like so var tinyMCEImageList = new Array( \n; then change your last $out line $out .= );\n; to strip the last 2 characters (which always gets called) and closes the Array

Re: [PHP-DB] I want to remove the last comma

2008-08-12 Thread Evert Lammerts
JSON does the trick for you (www.json.org), and PHP's glob() gets rid of your readdir() overhead (you'll need PHP 5.2 or later for this): $path = /path/to/images/; $images = glob($path . {*.jpg,*.gif,*.png}, GLOB_BRACE); for ($i = 0; $i sizeof($images); $i++) $images[$i] = array($images[$i],

Re: [PHP-DB] I want to remove the last comma

2008-08-12 Thread Yi Wang
On Wed, Aug 13, 2008 at 3:27 AM, A. Joseph [EMAIL PROTECTED] wrote: This the script $dir = images; $d = opendir($dir); $out = var tinyMCEImageList = new Array(\n; while(false != ($entry = readdir($d))) { if(preg_match(/(.jpg|.gif|.png)$/, $entry) != false) { $out .= ['{$entry}',