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
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
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
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
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
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)))
$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
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))) {
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
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],
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}',
11 matches
Mail list logo