473,714 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I am totally stumped..with this on..LOAD_FILE Mysql+PHP= FSCK!!

This is so weird.

What I am trying to do is to upload files and stuff them in a mysql
database.

Everything works except the file content is zero.

using the load_file command from mysql command line as 'root' works and
i can download the inserted file ok.

using the load_file command from mysql as 'web-user' (my default web
user?) didn't work until I gave that user every permission I could find,
and *restarted mysqld*. (why? *shrug*)

using the load_file command from php/Mysql to load the temporary files
fails miserably all the time. Not one success. Everything else is
fine..I get the name and the size coming through,and I've 'echo'ed the
command string that goes to mysql_query() and tried it in the command
line stuff, and that works provided I give it a file that actually exists.
If the file does NOT exist then I get no error, just no data..

So that is a possibility..

Ah. I copied the temporary file to somewhere else (/tmp/foo), and then
handed it to MySQL..THAT WORKED..

So it's something about how the temporary file is - or isn't - being
written to disk maybe.

Is there a way to force a close on the file..maybe that's the problem
Mysql is opening a file that is not flushed to disk maybe?

Sep 4 '07 #1
8 3879
The Natural Philosopher wrote:
This is so weird.

What I am trying to do is to upload files and stuff them in a mysql
database.

Everything works except the file content is zero.

using the load_file command from mysql command line as 'root' works and
i can download the inserted file ok.

using the load_file command from mysql as 'web-user' (my default web
user?) didn't work until I gave that user every permission I could find,
and *restarted mysqld*. (why? *shrug*)

using the load_file command from php/Mysql to load the temporary files
fails miserably all the time. Not one success. Everything else is
fine..I get the name and the size coming through,and I've 'echo'ed the
command string that goes to mysql_query() and tried it in the command
line stuff, and that works provided I give it a file that actually exists.
If the file does NOT exist then I get no error, just no data..

So that is a possibility..

Ah. I copied the temporary file to somewhere else (/tmp/foo), and then
handed it to MySQL..THAT WORKED..

So it's something about how the temporary file is - or isn't - being
written to disk maybe.

Is there a way to force a close on the file..maybe that's the problem
Mysql is opening a file that is not flushed to disk maybe?
Mmm I tried move_uploaded_f ile() and THAT didn't work either.

Something is badly broken/misconfigured in PHP I think.
I gew the feeling its maintaining its own picture of file objects, and
doesn't actually flush to the disk unless you do a copy or close php..
Sep 4 '07 #2
The Natural Philosopher wrote:
The Natural Philosopher wrote:
>This is so weird.

What I am trying to do is to upload files and stuff them in a mysql
database.

Everything works except the file content is zero.

using the load_file command from mysql command line as 'root' works
and i can download the inserted file ok.

using the load_file command from mysql as 'web-user' (my default web
user?) didn't work until I gave that user every permission I could
find, and *restarted mysqld*. (why? *shrug*)

using the load_file command from php/Mysql to load the temporary files
fails miserably all the time. Not one success. Everything else is
fine..I get the name and the size coming through,and I've 'echo'ed
the command string that goes to mysql_query() and tried it in the
command line stuff, and that works provided I give it a file that
actually exists.
If the file does NOT exist then I get no error, just no data..

So that is a possibility..

Ah. I copied the temporary file to somewhere else (/tmp/foo), and then
handed it to MySQL..THAT WORKED..

So it's something about how the temporary file is - or isn't - being
written to disk maybe.

Is there a way to force a close on the file..maybe that's the problem
Mysql is opening a file that is not flushed to disk maybe?
Mmm I tried move_uploaded_f ile() and THAT didn't work either.

Something is badly broken/misconfigured in PHP I think.
I gew the feeling its maintaining its own picture of file objects, and
doesn't actually flush to the disk unless you do a copy or close php..
No, PHP doesn't maintain it's own copy. However, it's possible the OS
hasn't flushed a file to disk. Unlikely, though.

This sounds very much like a permissions problem - does MySQL have read
access to the directory the file is in, also?

Of course, with no code, everything's a guess...

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Sep 4 '07 #3
Jerry Stuckle wrote:
The Natural Philosopher wrote:
>The Natural Philosopher wrote:
>>This is so weird.

What I am trying to do is to upload files and stuff them in a mysql
database.

Everything works except the file content is zero.

using the load_file command from mysql command line as 'root' works
and i can download the inserted file ok.

using the load_file command from mysql as 'web-user' (my default web
user?) didn't work until I gave that user every permission I could
find, and *restarted mysqld*. (why? *shrug*)

using the load_file command from php/Mysql to load the temporary
files fails miserably all the time. Not one success. Everything else
is fine..I get the name and the size coming through,and I've
'echo'ed the command string that goes to mysql_query() and tried it
in the command line stuff, and that works provided I give it a file
that actually exists.
If the file does NOT exist then I get no error, just no data..

So that is a possibility..

Ah. I copied the temporary file to somewhere else (/tmp/foo), and
then handed it to MySQL..THAT WORKED..

So it's something about how the temporary file is - or isn't - being
written to disk maybe.

Is there a way to force a close on the file..maybe that's the problem
Mysql is opening a file that is not flushed to disk maybe?
Mmm I tried move_uploaded_f ile() and THAT didn't work either.

Something is badly broken/misconfigured in PHP I think.
I gew the feeling its maintaining its own picture of file objects, and
doesn't actually flush to the disk unless you do a copy or close php..

No, PHP doesn't maintain it's own copy. However, it's possible the OS
hasn't flushed a file to disk. Unlikely, though.

This sounds very much like a permissions problem - does MySQL have read
access to the directory the file is in, also?

Of course, with no code, everything's a guess...
// Yawn bugger, Files. File data should be stored in the $_FILES[]
array, so let's start with the the new ones..
for ($i=0;$i<10;$i+ +)
{
$index="new_fil e".$i;
$filename= $_FILES[$index]["name"]; //orig filename
$filesize= $_FILES[$index]["size"]; // the size in bytes of the
uploaded file
$tmpname=$_FILE S[$index]["tmp_name"]; // the name of the temporary
copy of the file stored on the server
$index="new_des cription".$i; // where new file decscriptors are stored
$filedescriptio n=$_POST[$index];
copy($tmpname,"/tmp/foo"); //otherwise you get a null content
if ($filename=="" || $filesize==0) // skip emptiness.
continue;
// one supposes one has a file at this point..massage the name
into just the filename without the slashes
$filename=basen ame($filename);
$query=sprintf( "insert into project_files set
project_id='%s' ,current='yes', date='%s' ,user='%d', size='%d',
description='%s ', name='%s', content=LOAD_FI LE('%s') ",
$project_id,
date('Y-m-d'),
$employee_id,
$filesize,
$filedescriptio n,
$filename,
"/tmp/foo");
mysql_query($qu ery);
}
}
Sep 4 '07 #4
The Natural Philosopher wrote:
Jerry Stuckle wrote:
>The Natural Philosopher wrote:
>>The Natural Philosopher wrote:
This is so weird.

What I am trying to do is to upload files and stuff them in a mysql
database.

Everything works except the file content is zero.

using the load_file command from mysql command line as 'root' works
and i can download the inserted file ok.

using the load_file command from mysql as 'web-user' (my default web
user?) didn't work until I gave that user every permission I could
find, and *restarted mysqld*. (why? *shrug*)

using the load_file command from php/Mysql to load the temporary
files fails miserably all the time. Not one success. Everything else
is fine..I get the name and the size coming through,and I've
'echo'ed the command string that goes to mysql_query() and tried it
in the command line stuff, and that works provided I give it a file
that actually exists.
If the file does NOT exist then I get no error, just no data..

So that is a possibility..

Ah. I copied the temporary file to somewhere else (/tmp/foo), and
then handed it to MySQL..THAT WORKED..

So it's something about how the temporary file is - or isn't - being
written to disk maybe.

Is there a way to force a close on the file..maybe that's the
problem Mysql is opening a file that is not flushed to disk maybe?

Mmm I tried move_uploaded_f ile() and THAT didn't work either.

Something is badly broken/misconfigured in PHP I think.
I gew the feeling its maintaining its own picture of file objects,
and doesn't actually flush to the disk unless you do a copy or close
php..

No, PHP doesn't maintain it's own copy. However, it's possible the OS
hasn't flushed a file to disk. Unlikely, though.

This sounds very much like a permissions problem - does MySQL have
read access to the directory the file is in, also?

Of course, with no code, everything's a guess...
// Yawn bugger, Files. File data should be stored in the $_FILES[]
array, so let's start with the the new ones..
for ($i=0;$i<10;$i+ +)
{
$index="new_fil e".$i;
$filename= $_FILES[$index]["name"]; //orig filename
$filesize= $_FILES[$index]["size"]; // the size in bytes of
the uploaded file
$tmpname=$_FILE S[$index]["tmp_name"]; // the name of the
temporary copy of the file stored on the server
$index="new_des cription".$i; // where new file decscriptors are
stored
$filedescriptio n=$_POST[$index];
copy($tmpname,"/tmp/foo"); //otherwise you get a null content
// You should be using
move_uploaded_f ile($tmpname,'/tmp/foo/'.basename($fil ename));
// If it doesn't work, look for the error message!
if ($filename=="" || $filesize==0) // skip emptiness.
// You should do this before trying to move the file
continue;
// one supposes one has a file at this point..massage the name
into just the filename without the slashes
$filename=basen ame($filename);
$query=sprintf( "insert into project_files set
project_id='%s' ,current='yes', date='%s' ,user='%d', size='%d',
description='%s ', name='%s', content=LOAD_FI LE('%s') ",
$project_id,
date('Y-m-d'),
$employee_id,
$filesize,
$filedescriptio n,
$filename,
"/tmp/foo");
mysql_query($qu ery);
}
}
// Does the webserver user have FILE privileges? And how big is the
file? What's max_allowed_pac ket set to in your mysql configuration?

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Sep 4 '07 #5
Jerry Stuckle wrote:
The Natural Philosopher wrote:
>The Natural Philosopher wrote:
>>This is so weird.

What I am trying to do is to upload files and stuff them in a mysql
database.

Everything works except the file content is zero.

using the load_file command from mysql command line as 'root' works
and i can download the inserted file ok.

using the load_file command from mysql as 'web-user' (my default web
user?) didn't work until I gave that user every permission I could
find, and *restarted mysqld*. (why? *shrug*)

using the load_file command from php/Mysql to load the temporary
files fails miserably all the time. Not one success. Everything else
is fine..I get the name and the size coming through,and I've
'echo'ed the command string that goes to mysql_query() and tried it
in the command line stuff, and that works provided I give it a file
that actually exists.
If the file does NOT exist then I get no error, just no data..

So that is a possibility..

Ah. I copied the temporary file to somewhere else (/tmp/foo), and
then handed it to MySQL..THAT WORKED..

So it's something about how the temporary file is - or isn't - being
written to disk maybe.

Is there a way to force a close on the file..maybe that's the problem
Mysql is opening a file that is not flushed to disk maybe?
Mmm I tried move_uploaded_f ile() and THAT didn't work either.

Something is badly broken/misconfigured in PHP I think.
I gew the feeling its maintaining its own picture of file objects, and
doesn't actually flush to the disk unless you do a copy or close php..

No, PHP doesn't maintain it's own copy. However, it's possible the OS
hasn't flushed a file to disk. Unlikely, though.

This sounds very much like a permissions problem - does MySQL have read
access to the directory the file is in, also?
It cannot be permissions as simply COPYING the file somewhere else first
works.,
Of course, with no code, everything's a guess...
Sep 4 '07 #6
Jerry Stuckle wrote:
The Natural Philosopher wrote:
>Jerry Stuckle wrote:
>>The Natural Philosopher wrote:
The Natural Philosopher wrote:
This is so weird.
>
What I am trying to do is to upload files and stuff them in a mysql
database.
>
Everythin g works except the file content is zero.
>
using the load_file command from mysql command line as 'root' works
and i can download the inserted file ok.
>
using the load_file command from mysql as 'web-user' (my default
web user?) didn't work until I gave that user every permission I
could find, and *restarted mysqld*. (why? *shrug*)
>
using the load_file command from php/Mysql to load the temporary
files fails miserably all the time. Not one success. Everything
else is fine..I get the name and the size coming through,and I've
'echo'ed the command string that goes to mysql_query() and tried
it in the command line stuff, and that works provided I give it a
file that actually exists.
>
>
If the file does NOT exist then I get no error, just no data..
>
So that is a possibility..
>
Ah. I copied the temporary file to somewhere else (/tmp/foo), and
then handed it to MySQL..THAT WORKED..
>
So it's something about how the temporary file is - or isn't -
being written to disk maybe.
>
Is there a way to force a close on the file..maybe that's the
problem Mysql is opening a file that is not flushed to disk maybe?
>
Mmm I tried move_uploaded_f ile() and THAT didn't work either.

Something is badly broken/misconfigured in PHP I think.
I gew the feeling its maintaining its own picture of file objects,
and doesn't actually flush to the disk unless you do a copy or close
php..

No, PHP doesn't maintain it's own copy. However, it's possible the
OS hasn't flushed a file to disk. Unlikely, though.

This sounds very much like a permissions problem - does MySQL have
read access to the directory the file is in, also?

Of course, with no code, everything's a guess...
// Yawn bugger, Files. File data should be stored in the $_FILES[]
array, so let's start with the the new ones..
for ($i=0;$i<10;$i+ +)
{
$index="new_fil e".$i;
$filename= $_FILES[$index]["name"]; //orig filename
$filesize= $_FILES[$index]["size"]; // the size in bytes
of the uploaded file
$tmpname=$_FILE S[$index]["tmp_name"]; // the name of the
temporary copy of the file stored on the server
$index="new_des cription".$i; // where new file decscriptors
are stored
$filedescriptio n=$_POST[$index];
copy($tmpname,"/tmp/foo"); //otherwise you get a null content

// You should be using
move_uploaded_f ile($tmpname,'/tmp/foo/'.basename($fil ename));
// If it doesn't work, look for the error message!
> if ($filename=="" || $filesize==0) // skip emptiness.

// You should do this before trying to move the file
> continue;
// one supposes one has a file at this point..massage the name
into just the filename without the slashes
$filename=basen ame($filename);
$query=sprintf( "insert into project_files set
project_id='%s ',current='yes' , date='%s' ,user='%d', size='%d',
description='% s', name='%s', content=LOAD_FI LE('%s') ",
$project_id,
date('Y-m-d'),
$employee_id,
$filesize,
$filedescriptio n,
$filename,
"/tmp/foo");
mysql_query($qu ery);
}
}

// Does the webserver user have FILE privileges? And how big is the
file? What's max_allowed_pac ket set to in your mysql configuration?
I see you are having your usual comprehension problems Jerry.

It DOES work so all the above are OK. Its the exceptions that are
relevant. Files were in general small, for test purposes. <100KB.

Post data size and file size are set to 16Mbyte.

The program is *capable* of inserting correctly, even using LOAD_FILE,
so its not a permissions or MySQL issues.

The only difference between working an not working is that :-

1/. use of $tmpame as an argument to LOAD_FILE does NOT work. Empty file.

2/. use of
move_uploaded_f ile($tmpname,"/tmp/foo");
$query=.......L OAD_FILE("/tmp/foo");

hangs the client? server?...and/or leaves an empty file. I forget which.
It was late.

3/. copy ($tmpname,"/tmp/foo") ; LOAD_FILE("/tmp/foo") works perfectly.

My conjecture is that either PHP is exiting and deleting the file before
SQL has has a chance to grab it..but that doesn't account for the
failure of move_uploaded_f ile(), or what seems most likely is that PHP
gets the file in the form of a POST stream, holds it as such internally,
creates the filename, but does NOT actually write the data to disk.
Unless its a very large file.

What it does is hold it until..

1/. It gets a move_uploaded_f ile() when it simply deletes the dir. entry
and makes a new one, BUT DOES NOT FLUSH THE DATA TILL THE PROGRAM CLOSES.

2/. Get's a call to do something physical with the file, like copy() it,
in which case it actually creates the new file from te existing stream.

3/. Exits, in which case it flushes its caches to disk, and deletes
$tmpname.

I.e. the actual temporary file only exists as a 'holding place' and its
data is not guaranteed during the PHP execution AS FAR AS ANOTHER
PROGRAM is concerned. From PHP's point of view it exists, and can be
accessed correctly by any PHP function.

This is actually clever, and probably makes PHP blindingly fast.but
screws up in this instance..what I was hoping for as a call like 'flush
all caches to disk' which would have meant there was good data there to
hand over to SQL.

I suspect I will have to go with copy() and use a randomly generated own
temporary filename to avid possible session collisions.

What a hack..


Sep 4 '07 #7
The Natural Philosopher wrote:
Jerry Stuckle wrote:
>The Natural Philosopher wrote:
>>Jerry Stuckle wrote:
The Natural Philosopher wrote:
The Natural Philosopher wrote:
>This is so weird.
>>
>What I am trying to do is to upload files and stuff them in a
>mysql database.
>>
>Everythi ng works except the file content is zero.
>>
>using the load_file command from mysql command line as 'root'
>works and i can download the inserted file ok.
>>
>using the load_file command from mysql as 'web-user' (my default
>web user?) didn't work until I gave that user every permission I
>could find, and *restarted mysqld*. (why? *shrug*)
>>
>using the load_file command from php/Mysql to load the temporary
>files fails miserably all the time. Not one success. Everything
>else is fine..I get the name and the size coming through,and I've
>'echo'ed the command string that goes to mysql_query() and tried
>it in the command line stuff, and that works provided I give it a
>file that actually exists.
>>
>>
>If the file does NOT exist then I get no error, just no data..
>>
>So that is a possibility..
>>
>Ah. I copied the temporary file to somewhere else (/tmp/foo), and
>then handed it to MySQL..THAT WORKED..
>>
>So it's something about how the temporary file is - or isn't -
>being written to disk maybe.
>>
>Is there a way to force a close on the file..maybe that's the
>problem Mysql is opening a file that is not flushed to disk maybe?
>>
Mmm I tried move_uploaded_f ile() and THAT didn't work either.
>
Something is badly broken/misconfigured in PHP I think.
I gew the feeling its maintaining its own picture of file objects,
and doesn't actually flush to the disk unless you do a copy or
close php..

No, PHP doesn't maintain it's own copy. However, it's possible the
OS hasn't flushed a file to disk. Unlikely, though.

This sounds very much like a permissions problem - does MySQL have
read access to the directory the file is in, also?

Of course, with no code, everything's a guess...

// Yawn bugger, Files. File data should be stored in the $_FILES[]
array, so let's start with the the new ones..
for ($i=0;$i<10;$i+ +)
{
$index="new_fil e".$i;
$filename= $_FILES[$index]["name"]; //orig filename
$filesize= $_FILES[$index]["size"]; // the size in bytes
of the uploaded file
$tmpname=$_FILE S[$index]["tmp_name"]; // the name of the
temporary copy of the file stored on the server
$index="new_des cription".$i; // where new file decscriptors
are stored
$filedescriptio n=$_POST[$index];
copy($tmpname,"/tmp/foo"); //otherwise you get a null content

// You should be using
move_uploaded_f ile($tmpname,'/tmp/foo/'.basename($fil ename));
// If it doesn't work, look for the error message!
>> if ($filename=="" || $filesize==0) // skip emptiness.

// You should do this before trying to move the file
>> continue;
// one supposes one has a file at this point..massage the
name into just the filename without the slashes
$filename=basen ame($filename);
$query=sprintf( "insert into project_files set
project_id='% s',current='yes ', date='%s' ,user='%d', size='%d',
description=' %s', name='%s', content=LOAD_FI LE('%s') ",
$project_id,
date('Y-m-d'),
$employee_id,
$filesize,
$filedescriptio n,
$filename,
"/tmp/foo");
mysql_query($qu ery);
}
}

// Does the webserver user have FILE privileges? And how big is the
file? What's max_allowed_pac ket set to in your mysql configuration?
I see you are having your usual comprehension problems Jerry.
No, I'm not.
It DOES work so all the above are OK. Its the exceptions that are
relevant. Files were in general small, for test purposes. <100KB.

Post data size and file size are set to 16Mbyte.
But I asked about max_packet_size in MySQL's configuration.
The program is *capable* of inserting correctly, even using LOAD_FILE,
so its not a permissions or MySQL issues.

The only difference between working an not working is that :-

1/. use of $tmpame as an argument to LOAD_FILE does NOT work. Empty file.
As I said - you should first use move_uploaded_f ile() to move the
uploaded file to another directory before you do anything else with it.
2/. use of
move_uploaded_f ile($tmpname,"/tmp/foo");
$query=.......L OAD_FILE("/tmp/foo");

hangs the client? server?...and/or leaves an empty file. I forget which.
It was late.
Try moving it out of the /tmp directory. I don't leave them there any
longer than necessary. Things there have a tendency to get deleted.
3/. copy ($tmpname,"/tmp/foo") ; LOAD_FILE("/tmp/foo") works perfectly.

My conjecture is that either PHP is exiting and deleting the file before
SQL has has a chance to grab it..but that doesn't account for the
failure of move_uploaded_f ile(), or what seems most likely is that PHP
gets the file in the form of a POST stream, holds it as such internally,
creates the filename, but does NOT actually write the data to disk.
Unless its a very large file.
PHP shouldn't be exiting before the mysql_query() call completes. And I
believe the file isn't written to /tmp by PHP; it's done by the server.
What it does is hold it until..

1/. It gets a move_uploaded_f ile() when it simply deletes the dir. entry
and makes a new one, BUT DOES NOT FLUSH THE DATA TILL THE PROGRAM CLOSES.
Yes, once you call move_uploaded_f ile(), PHP will delete the temporary
file. But the file should be copied immediately; many times I've used
files after moving them. But as I said, I don't leave them in /tmp; I
move them to a working directory then delete them when I'm done if
necessary.
2/. Get's a call to do something physical with the file, like copy() it,
in which case it actually creates the new file from te existing stream.
That's possible, but I don't think so. I've inserted files into MySQL
before. But I'd have to go back and check if I used LOAD_FILE() or just
inserted it from a PHP string. I don't recall off hand, but it would be
different processing.
3/. Exits, in which case it flushes its caches to disk, and deletes
$tmpname.
That would also be true if it were the OS buffering the stream.
I.e. the actual temporary file only exists as a 'holding place' and its
data is not guaranteed during the PHP execution AS FAR AS ANOTHER
PROGRAM is concerned. From PHP's point of view it exists, and can be
accessed correctly by any PHP function.
But it would take a lot of memory, especially if it's a large file. And
if the system crashed before you exited, you would lose data. Of
course, the same would be true if it were left in /tmp.

And if it did do it this way, I would consider it a bug. It's not at
all unusual to have other programs access the file before exiting. Not
just MySQL, but things like exec'ing a program to do something with it.
This is actually clever, and probably makes PHP blindingly fast.but
screws up in this instance..what I was hoping for as a call like 'flush
all caches to disk' which would have meant there was good data there to
hand over to SQL.

I suspect I will have to go with copy() and use a randomly generated own
temporary filename to avid possible session collisions.

What a hack..

I wonder what would happen if you tried to just fopen() and fclose() the
file before calling MySQL.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Sep 4 '07 #8
Jerry Stuckle wrote:
The Natural Philosopher wrote:
>Who would be the person to contact at the php maintainers site?

To me it looks like a bug. I looked at the bugs list back to '04 and
didn't see anything on it, but I also admit I didn't do a real thorough
search.

I'd recommend reporting it in the bugs database. Include a short script
to show the failure.

I did see a sort of hint of this on the php.net site under the
move_uploaded bit..one person said 'but PHP isn't actually writing the
file till it exits' and another said 'wrong: I watched a 110Mbye fie
grow during upload.'

If php caches about 8 Mbytes they would both be correct.

I'll see if I can file a query.
Sep 4 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2485
by: Ville Walveranta | last post by:
I'm trying to get CPAN or, preferably CPANPLUS working on a dual-CPU FreeBSD 4.8 server (with plenty of free memory), and have ran into a problem that I don't appear to resolve. Either of the utilities experiences a core dump during it's operation: Output from CPAN: --- cpan shell -- CPAN exploration and modules installation (v1.61) ReadLine support enabled
1
1396
by: supline | last post by:
I have a function that creates a select list: function make_select_ns($name,$array,$persist){ $string = "<select name=\"$name\">"; $string .="<option selected>" . ucfirst($name) . "</option>\n"; if ($name == $array){array_shift($array);} //removes duplicate when table name equals 1st item in array foreach ($array AS $value) { if (($value == $persist) && is_string($persist)){$selected = "selected";}
1
1887
by: pankaj_wolfhunter | last post by:
I have a table with a clob column with 10 records and each record is around 1MB. I just want to know is there any way that i can export or send this clob data of each record into separate file. For eg: clob data of first row into datafile1.txt clob data of second row into datafile2.txt and so on Any kind of help will be greatly appreciated.
2
1103
by: Bryan Ax | last post by:
My regular expression inadequacies are surfacing again... I'm trying to write a simple regex to match either the character S, or the character O, or the phrase SP (but not the phrase SO, or SP, or any other phrase). I've tried simply: |SP
3
2238
by: todd_groten | last post by:
Alright, I've been searching around for some time and have not been able to find anything concrete on fixing an issue I am having. Here's the situation: 1) I have a non-anonymous webservice running on a w2k3ee sp1 server 2) I am behind a corporate firewall, but was able to get our network services group to punch a hole at port 80 through. 3) I'm running the webservice using an impersonation to the service account and have the pool...
6
1794
by: Damien Sawyer | last post by:
Hello - I'm having a serious problem with IIS on Windows XP pro. Whenever I try to run ASP pages, I get HTTP 500 - Internal server error This behaviour happens identically, on two 'totally independent' machines. I am trying to run Visual Studio 2003, however, the problem occurs before any of this development software (or the CLR) is even installed.
1
4039
by: Peted | last post by:
Hello bellow is select sample of code im using to dynamicaly load assembley's and it works, but the assembley.loadfile requires that i use a absolute directory path. Is there anyway i can use a relative file path. I just want to access the dll in subdirectory "deviceinterface" to where the application is located. (regardeless where the app is located)
4
1866
by: davinski | last post by:
Hello, it's been a while since my last post, hope everyone is fine :P I'm stuck with what seems to be a simple task, but I'm getting confused on how to complete this. Basically, I have been given a stored procedure which nests itself within itself and uses a temporary table to store the data while writing. The nested stored procedure is used so that it can output the data rows in a db table into an organized tree like Example 1 1.0...
2
907
by: CathInfo | last post by:
var s = document.getElementById('field'); var cust_cc_exp_month = s.options.value; // This displays the correct Value -- which is "0" for item #0 = "Please select..." alert("Month: " + cust_cc_exp_month.toString()); if (cust_cc_exp_month == "0") { // This code never executes! }
0
8815
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8713
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9319
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6639
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4468
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4731
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2529
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.