php-general Digest 14 Aug 2007 16:40:34 -0000 Issue 4961
Topics (messages 260797 through 260815):
About Buggy SQL Query
260797 by: Kelvin Park
260798 by: Chris
260799 by: Kelvin Park
260801 by: Kelvin Park
Re: HTTP methods, Web Browsers and REST
260800 by: Chris
260809 by: Nathan Nobbe
Re: problem in <tr>
260802 by: sanjeevn
zip freezes - how to handle corrupt CRC in zip-file
260803 by: ecc
260805 by: sanjeevn
260807 by: ecc
Re: apache content negotiation and $_GET
260804 by: Per Jessen
COM Objects
260806 by: Nathan Wallis
Looking for xslt extension that was part of php4
260808 by: Per Jessen
260810 by: Thijs Lensselink
260811 by: Thijs Lensselink
260812 by: Per Jessen
260813 by: Per Jessen
www.soongy.com
260814 by: Gevorg Harutyunyan
Re: very strange behavior.... incomplete query performed
260815 by: Alain Roger
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
mySQL database becomes inaccessible after a buggy sql string gets queried.
The SQL server runs fine, however it seems like just the database is being
looped infinitely so to say.
Here is an example:
(PHP)
$sql = "SELECT * FROM DB_TABLE WHERE PR_NUMBER = $whatever, DFLJJ =
$SD;LOOE"; (<-- invalid sql query string)
mysql_query($sql);
When this query string is queried during the (webpage) loading process, the
webpage just gets timed out without any error nor warning messages.
Does anyone know if there is a certain way to prevent mysql database from
stalling due to buggy sql strings?
--- End Message ---
--- Begin Message ---
Kelvin Park wrote:
mySQL database becomes inaccessible after a buggy sql string gets queried.
The SQL server runs fine, however it seems like just the database is being
looped infinitely so to say.
Here is an example:
(PHP)
$sql = "SELECT * FROM DB_TABLE WHERE PR_NUMBER = $whatever, DFLJJ =
$SD;LOOE"; (<-- invalid sql query string)
mysql_query($sql);
When this query string is queried during the (webpage) loading process, the
webpage just gets timed out without any error nor warning messages.
Does anyone know if there is a certain way to prevent mysql database from
stalling due to buggy sql strings?
use mysql_real_escape_string to stop it from happening.
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
mySQL database becomes inaccessible after a buggy sql string gets queried.
The SQL server runs fine, however it seems like just the database is being
looped infinitely so to say.
Here is an example:
(PHP)
$sql = "SELECT * FROM DB_TABLE WHERE PR_NUMBER = $whatever, DFLJJ =
$SD;LOOE"; (<-- invalid sql query string)
mysql_query($sql);
When this query string is queried during the (webpage) loading process, the
webpage just gets timed out without any error nor warning messages.
Does anyone know if there is a certain way to prevent mysql database from
stalling due to buggy sql strings?
--- End Message ---
--- Begin Message ---
Chris wrote:
Kelvin Park wrote:
mySQL database becomes inaccessible after a buggy sql string gets
queried.
The SQL server runs fine, however it seems like just the database is
being
looped infinitely so to say.
Here is an example:
(PHP)
$sql = "SELECT * FROM DB_TABLE WHERE PR_NUMBER = $whatever, DFLJJ =
$SD;LOOE"; (<-- invalid sql query string)
mysql_query($sql);
When this query string is queried during the (webpage) loading
process, the
webpage just gets timed out without any error nor warning messages.
Does anyone know if there is a certain way to prevent mysql database
from
stalling due to buggy sql strings?
use mysql_real_escape_string to stop it from happening.
Thanks, I looked over some comments posted on the PHP library web site
under mysql_real_escape_string function. I didn't realize it is also
used to aid sql injection prevention.
--- End Message ---
--- Begin Message ---
Looking over PHP i can see a web service client
could be written for a
RESTful web service using the curl extension (and perhaps others as well)
because it facilitates an
ability to invoke the HTTP PUT and DELETE methods.
Now, coming to my question.. Looking at the W3C page on the XHTML 1.0 form
tag specification <http://www.w3schools.com/tags/tag_form.asp>, it is
clear the method attribute supports only get and post. What i wonder is
why would it not also support
put and delete?
Because they are not part of forms, they are something the webserver
needs to handle.
http://www.apacheweek.com/features/put
Particularly this sentence:
"POST method is normally handed a script which is explicitly named by
the resource (that is, something that already exists), while a PUT
request could be directed at a resource which does not (yet) exist."
--
Postgresql & php tutorials
http://www.designmagick.com/
--- End Message ---
--- Begin Message ---
Chris,
thanks for your reply
it sounds like apache does allow the use of a script to handle PUT requests
In fact, Apache handles PUT exactly like it handles the POST method. That
is, it supports it, but in order for it to do anything useful you need to
supply a suitable CGI program.
getting php to handle PUT requests is probably not too complicated.. there
is this other constraint, imposed by the protocol, that is noteworthy:
Another difference is that the POST method can be used in response to a
form, while the PUT method can only contain a single data item.
so, perhaps, in designing a page intended to allow the user to create a new
datum in an application, the data elements should probably be sent delimited
by / in the url; then parsing the url would provide the script w/ the
elements it needed to create the new datum in the application.
this helps me to understand the basics of using PUT and DELETE in a php
application, but im still unclear as to how PUT and DELETE methods can be
invoked on the server from a browser. to be specific, is a client side
scripting technology like javascript or otherwise mandatory in order to
invoke PUT and DELETE from the browser, or is there some way to invoke these
methods on the server natively ??
from the sound of it; PUT and DELETE wont work well when using a browser to
interact w/ a server, it seems like they are mostly supplied for
programmatic interaction only, but that sounds odd to me.... i wonder what
the intended use of PUT and DELETE was when they were first created and
added to the HTTP.
-nathan
On 8/14/07, Chris <[EMAIL PROTECTED]> wrote:
>
>
> > Looking over PHP i can see a web service client
> > could be written for a
> > RESTful web service using the curl extension (and perhaps others as
> well)
> > because it facilitates an
> > ability to invoke the HTTP PUT and DELETE methods.
> > Now, coming to my question.. Looking at the W3C page on the XHTML 1.0form
> > tag specification <http://www.w3schools.com/tags/tag_form.asp>, it is
> > clear the method attribute supports only get and post. What i wonder
> is
> > why would it not also support
> > put and delete?
>
> Because they are not part of forms, they are something the webserver
> needs to handle.
>
> http://www.apacheweek.com/features/put
>
> Particularly this sentence:
>
> "POST method is normally handed a script which is explicitly named by
> the resource (that is, something that already exists), while a PUT
> request could be directed at a resource which does not (yet) exist."
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>
--- End Message ---
--- Begin Message ---
basically you want your page needs to be submitted to the next page when you
click on the <tr>
so do one thing. create 2 forms..
form 1 will have your main table and the datas
form 2 will have hidden inputs
for each <tr> you need to assign a variable called rownumber and create the
hidden fields in each td as
name11, name12, name13....
name21, name22, name33....
i think you understand what i am trying to explain...
and convert the <tr> as <tr
onclick="submitvaluetoanotherform('thisrownumber');">
define the function which submits the value of this rownumbers value into
the second form and say submit form2 automatically
Thanks
On 8/14/07, shivendra <[EMAIL PROTECTED]> wrote:
>
>
>
> Sir,u r not getting what i m trying to say,my problem is how can i send
> the
> values of <td>s in a perticuler row,by a function in onClick event of that
> row.actuallly the values are coming from database,and i what i want when i
> click a perticuler row the values are sent to some other page:
> <table>
> <tr name="t1" id="t1">
> <td>monu</td><td>23</td>
> </tr>
> <tr name="t2" id="t2">
> <td>suman</td><td>24</td>
> </tr>
> </table>
> like the values in <td>s of <tr name="t1"> is "monu" and "23" ,i want when
> i
> click on <tr name="t1"> ,"monu" and "23" is sent to some other
> page,similarly same procedure follows when i click the <tr name="t2"> but
> this time the value would be "suman" and "24",i think u r getting what i
> m
> try to say.pls send the code for this:
> --
> View this message in context:
> http://www.nabble.com/problem-in-%3Ctr%3E-tf4253021.html#a12138652
> Sent from the PHP - General mailing list archive at Nabble.com.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Warm Regards
Sanjeev
------------------------------------------------
http://www.sanchanworld.com/
http://webdirectory.sanchanworld.com/
http://webhosting.sanchanworld.com/
--- End Message ---
--- Begin Message ---
Hi @all,
i´m reading zip-files with the php zip-functions without a problem. Now i
got and Zip containing an corrupt crc (If i open this file via winzip, the
error is shown).
It looks like the php functions for zip-handeling "zip_entry_read" and
"ZipArchive::getFrom..." do not quit on a bad crc checksum.... so these
functions read in the file and than are in an infinite loop. Because i use
PHP-GTK2 my tool feezes and the process has to be killed. On an
web-enviroment this could also a big problem ..... ok, user-zip handeling on
web is not the best idea :-)
I´ve found no way to find out, if an file in the zip file is an valid or
corrupt entry. The output of "ZipArchive::statName" give me no info about
the state of an entry.
Is there any trick out there, how to manage this problem. Maybe this is an
bug or missing feature in the zip extensions. Dont know!
Regards,
Andreas
--
View this message in context:
http://www.nabble.com/zip-freezes---how-to-handle-corrupt-CRC-in-zip-file-tf4266474.html#a12142189
Sent from the PHP - General mailing list archive at Nabble.com.
--- End Message ---
--- Begin Message ---
Use error handling function for time being and exit from the loop
where control going in the loop.
On 8/14/07, ecc <[EMAIL PROTECTED]> wrote:
>
>
> Hi @all,
>
> i´m reading zip-files with the php zip-functions without a problem. Now i
> got and Zip containing an corrupt crc (If i open this file via winzip, the
> error is shown).
>
> It looks like the php functions for zip-handeling "zip_entry_read" and
> "ZipArchive::getFrom..." do not quit on a bad crc checksum.... so these
> functions read in the file and than are in an infinite loop. Because i use
> PHP-GTK2 my tool feezes and the process has to be killed. On an
> web-enviroment this could also a big problem ..... ok, user-zip handeling
> on
> web is not the best idea :-)
>
> I´ve found no way to find out, if an file in the zip file is an valid or
> corrupt entry. The output of "ZipArchive::statName" give me no info about
> the state of an entry.
>
> Is there any trick out there, how to manage this problem. Maybe this is an
> bug or missing feature in the zip extensions. Dont know!
>
> Regards,
> Andreas
> --
> View this message in context:
> http://www.nabble.com/zip-freezes---how-to-handle-corrupt-CRC-in-zip-file-tf4266474.html#a12142189
> Sent from the PHP - General mailing list archive at Nabble.com.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Warm Regards
Sanjeev
------------------------------------------------
http://www.sanchanworld.com/
http://webdirectory.sanchanworld.com/
http://webhosting.sanchanworld.com/
--- End Message ---
--- Begin Message ---
Hi Sanjeev,
thank you for your fast answer.
what do you mean with "error handling function" ()? If i read in the
zip_entry, the function is freezing.... no chance to handle the error,
because php dont give me an error or exception. If php find a corrupt file,
it freezes on this position. Maybe i can post the corrupt zip, so somebody
can try it :-)
Thank you for your idea.
Andreas
Sanjeev N wrote:
>
> Use error handling function for time being and exit from the loop
> where control going in the loop.
>
>
> On 8/14/07, ecc <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi @all,
>>
>> i´m reading zip-files with the php zip-functions without a problem. Now i
>> got and Zip containing an corrupt crc (If i open this file via winzip,
>> the
>> error is shown).
>>
>> It looks like the php functions for zip-handeling "zip_entry_read" and
>> "ZipArchive::getFrom..." do not quit on a bad crc checksum.... so these
>> functions read in the file and than are in an infinite loop. Because i
>> use
>> PHP-GTK2 my tool feezes and the process has to be killed. On an
>> web-enviroment this could also a big problem ..... ok, user-zip handeling
>> on
>> web is not the best idea :-)
>>
>> I´ve found no way to find out, if an file in the zip file is an valid or
>> corrupt entry. The output of "ZipArchive::statName" give me no info about
>> the state of an entry.
>>
>> Is there any trick out there, how to manage this problem. Maybe this is
>> an
>> bug or missing feature in the zip extensions. Dont know!
>>
>> Regards,
>> Andreas
>> --
>> View this message in context:
>> http://www.nabble.com/zip-freezes---how-to-handle-corrupt-CRC-in-zip-file-tf4266474.html#a12142189
>> Sent from the PHP - General mailing list archive at Nabble.com.
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> --
> Warm Regards
> Sanjeev
> ------------------------------------------------
> http://www.sanchanworld.com/
> http://webdirectory.sanchanworld.com/
> http://webhosting.sanchanworld.com/
>
>
--
View this message in context:
http://www.nabble.com/zip-freezes---how-to-handle-corrupt-CRC-in-zip-file-tf4266474.html#a12142440
Sent from the PHP - General mailing list archive at Nabble.com.
--- End Message ---
--- Begin Message ---
Stut wrote:
> Actually it suggests exactly that. Apache is giving PHP the query
> string, and PHP does nothing to it before it puts it in the $_SERVER
> variable. So this basically means that when you use the type-map
> Apache is not populating the query string variable.
>
> In short, I'm 5-9's% certain it's Apache that's throwing it away.
FYI - http://issues.apache.org/bugzilla/show_bug.cgi?id=33112
/Per
--- End Message ---
--- Begin Message ---
I am having some trouble instantiating a COM object, it seems to crash my
web server every time I call the line.
$tve=new COM("TVE3COM.TVE");
I have downloaded a trial version of the Turbo Video Engine SDK and this was
a line I got from the php examples folder.
Is anyone familiar with this SDK? I ran the installer which I guess would
install the files in the correct location. Or do I need to have the DLL's
in the same directory?
I am very new to all of this.
Thanks again,
Nathan
--- End Message ---
--- Begin Message ---
I am moving a web application from php4 to php5, and have just stumbled
over the lack of the xslt() extension in php5. The manual says it's
been moved to PECL = pecl.php.net, but I can't find it there. Does
anyone know where it has gone?
(migrating the code to the newer php5 XSL support is not yet an option).
thanks
Per Jessen
--- End Message ---
--- Begin Message ---
On Tue, 14 Aug 2007 15:13:48 +0200, Per Jessen <[EMAIL PROTECTED]> wrote:
> I am moving a web application from php4 to php5, and have just stumbled
> over the lack of the xslt() extension in php5. The manual says it's
> been moved to PECL = pecl.php.net, but I can't find it there. Does
> anyone know where it has gone?
> (migrating the code to the newer php5 XSL support is not yet an option).
>
>
> thanks
> Per Jessen
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
The manual also says :
If you need xslt support with PHP 5 you can use the XSL extension.
--- End Message ---
--- Begin Message ---
On Tue, 14 Aug 2007 15:13:48 +0200, Per Jessen <[EMAIL PROTECTED]> wrote:
> I am moving a web application from php4 to php5, and have just stumbled
> over the lack of the xslt() extension in php5. The manual says it's
> been moved to PECL = pecl.php.net, but I can't find it there. Does
> anyone know where it has gone?
> (migrating the code to the newer php5 XSL support is not yet an option).
>
>
> thanks
> Per Jessen
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
Seems the xslt extension that should have been placed in PECL was never
released.
http://bugs.php.net/bug.php?id=41934
--- End Message ---
--- Begin Message ---
Thijs Lensselink wrote:
> The manual also says :
>
> If you need xslt support with PHP 5 you can use the XSL extension.
Yeah, but it is not compatible with the php4 xslt extension, so I would
have to migrate the code, which is as I said not an option yet.
/Per Jessen
--- End Message ---
--- Begin Message ---
Thijs Lensselink wrote:
> Seems the xslt extension that should have been placed in PECL was
> never released. http://bugs.php.net/bug.php?id=41934
Ah, wonderful. That's what I love about PHP ...
/Per Jessen
--- End Message ---
--- Begin Message ---
Hello,
I am Gevorg.
I just wanted to introduce you my new PHP based work here www.soongy.com
<http://www.soongy.com/> .
It is working on PHP and MySQL and here is used DHTML, AJAX.
Thank you very much.
Waiting for your response
Regards,
Gevorg
--- End Message ---
--- Begin Message ---
There was no error message...hust after few secunds it stop as normaly it
should do...
but i add -> set_time_limit(0); and it works.
adding around 20.000 records to database takes some time :-)
around 1:41 minutes.
I was thinking that i could be faster... :-(
Alain
On 8/13/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>
> Are you using E_ALL?
>
> Any error messages?
>
> My first suspect is you are hitting php.ini time_limit setting, or
> possibly the memory_limit.
>
> On Sun, August 12, 2007 7:09 am, Alain Roger wrote:
> > Hi,
> >
> > I'm still working on importing CSV file content (20.000 records) to
> > database
> > PostgreSQL.
> >
> > when i run the query, once i stored into my table 5218 records,
> > another
> > time 5231 another time 4713 and so on....
> > every time the amount of records imported to DB is different.
> >
> > Do you have any idea from where it could come ?
> >
> > Here is my PHP code :
> >
> >> while (($data = fgetcsv($handle, 1000, ",")) !== FALSE)
> >> {
> >> $num = count($data);
> >>
> >> if($row>1)
> >> {
> >>
> >> $charsetIN ='windows-1250';
> >> $charsetOUT = 'UTF-8';
> >>
> >> $publisher = iconv($charsetIN, $charsetOUT,
> >> $data[0]);
> >> $program = iconv($charsetIN,
> >> $charsetOUT,
> >> $data[1]);
> >> $version = iconv($charsetIN,
> >> $charsetOUT,
> >> $data[2]);
> >> $path = iconv($charsetIN,
> >> $charsetOUT, $data[4]);
> >> $path =
> >> str_replace("\\","\\\\",$path);
> >> $licensing_file = iconv($charsetIN, $charsetOUT,
> >> $data[5]);
> >> $barcode = iconv($charsetIN,
> >> $charsetOUT,
> >> $data[6]);
> >> $pcinfo_id = iconv($charsetIN,
> >> $charsetOUT,
> >> $data[8]);
> >>
> >> $date_audit = iconv($charsetIN,
> >> $charsetOUT,
> >> trim(str_replace(" ","",$data[11])));
> >>
> >> $locality = iconv($charsetIN,
> >> $charsetOUT,
> >> $data[13]);
> >> $area = iconv($charsetIN,
> >> $charsetOUT, $data[12]);
> >> $username = iconv($charsetIN,
> >> $charsetOUT,
> >> $data[14]);
> >> $personal_number = iconv($charsetIN, $charsetOUT,
> >> $data[15]);
> >>
> >>
> >> $result = pg_query($dbconn,"set search_path = sw_audit;");
> >> echo "result (set search_path) = ".$result."<br/><br/>";
> >> $res=pg_query("SELECT nextval('tmp_importedxls_rec_id_seq')
> >> as
> >> key");
> >> $row=pg_fetch_array($res, 0);
> >> $key=$row['key'];
> >>
> >> $sql = "INSERT INTO tmp_importedxls (rec_id, publisher,
> >> program,
> >> version, path, licensing_file, date_audit, barcode, pcinfo_ident,
> >> area,
> >> locality, users, personal_number)
> >> VALUES ($key,
> >> '$publisher',
> >> '$program',
> >> '$version',
> >> '$path',
> >>
> >> '$licensing_file','".SplitDate(".",$date_audit)."',
> >> '$barcode',
> >> '$pcinfo_id',
> >> '$area',
> >> '$locality',
> >> '$username',
> >> '$personal_number');";
> >>
> >> //echo "SQL : " .$sql."<br/><br/>";
> >>
> >> $result = pg_query($dbconn,$sql);
> >> if (!$result)
> >> {
> >> die("Error in SQL query: " . pg_last_error());
> >> }
> >> else
> >> {
> >> echo "result (INSERT INTO) = ".$result."<br />";
> >> }
> >>
> >> }
> >> $row++;
> >> }
> >> fclose($handle);
> >>
> >> pg_close($dbconn);
> >
> >
> >
> > thanks a lot for any help.
> >
> >
> > --
> > Alain
> > ------------------------------------
> > Windows XP SP2
> > PostgreSQL 8.2.3
> > Apache 2.2.4
> > PHP 5.2.3
> >
>
>
> --
> Some people have a "gift" link here.
> Know what I want?
> I want you to buy a CD from some indie artist.
> http://cdbaby.com/browse/from/lynch
> Yeah, I get a buck. So?
>
>
--
Alain
------------------------------------
Windows XP SP2
PostgreSQL 8.2.3
Apache 2.2.4
PHP 5.2.3
--- End Message ---