Re: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Gaurav Kumar
There is no best function as such. Everything depends upon your requirement. You can also use fopen() to get the contents of the remote file and do some error handling that if you get any content then display image else a message etc.. Gaurav Kumar (Team Lead- open source) oswebstudio.com On

[PHP] Re: php/mysql Query Question.

2009-09-16 Thread Peter Ford
ad...@buskirkgraphics.com wrote: Before most of you go on a rampage of how to please read below... As most of you already know when using MySQL from the shell you can write your queries in html format in an out file. Example: shellmysql -uyourmom -plovesme --html This now will return

Re: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Ashley Sheridan
On Wed, 2009-09-16 at 12:08 +0530, Gaurav Kumar wrote: There is no best function as such. Everything depends upon your requirement. You can also use fopen() to get the contents of the remote file and do some error handling that if you get any content then display image else a message etc..

RE: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Andrea Giammarchi
The way I've always seen this approached before is by using the wget command, which can be asked to just return the headers for a page. In your case you'd be looking for all 200 codes, which means that all the sites are up. This is faster than asking to return a full image each time. but

RE: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Ashley Sheridan
On Wed, 2009-09-16 at 11:17 +0200, Andrea Giammarchi wrote: The way I've always seen this approached before is by using the wget command, which can be asked to just return the headers for a page. In your case you'd be looking for all 200 codes, which means that all the sites are up.

RE: [PHP] best function to use ~ file_get_contents or ?

2009-09-16 Thread Andrea Giammarchi
This is what I said, except if you want to grab the content you need to request HEAD first and eventually GET, and this is slower than just GET parsing headers. In any case, curl is the answer, imho. Regards Requesting only the headers is a lot faster than requesting the headers AND the

[PHP] Insert Symbol into Mysql

2009-09-16 Thread Samrat Kar
I want to insert symbols like degree, plusminus, currency along with string into Mysql database. Front is HTML form with javascript. Server side scripts are written in PHP. Please help. Regards, Samrat Kar

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
does JavaScript use the proper way to encode strings as encodeURIComponent is, and for each sent key/value pair? Is MySQL table charset ut8_general_ci ? If not, do you convert sent UTF-8 charset into table charset? In few words we miss the way/library used to send data, the default PHP

Re: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Ashley Sheridan
On Wed, 2009-09-16 at 17:00 +0530, Samrat Kar wrote: I want to insert symbols like degree, plusminus, currency along with string into Mysql database. Front is HTML form with javascript. Server side scripts are written in PHP. Please help. Regards, Samrat Kar Two ways to do

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
He has no utf-8 charset in the table, so the first point is valid and htmlentities is the function ( http://uk.php.net/manual/en/function.htmlentities.php ) You need to remember that in this way you need to use htmlentities for *everything*, specially for searches, otherwise ° against #176;

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Ashley Sheridan
On Wed, 2009-09-16 at 14:47 +0200, Andrea Giammarchi wrote: He has no utf-8 charset in the table, so the first point is valid and htmlentities is the function ( http://uk.php.net/manual/en/function.htmlentities.php ) You need to remember that in this way you need to use htmlentities for

Re: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Jo�o C�ndido de Souza Neto
If he´s really using a any other charset instead of utf8 table, why not using utf8_decode and utf8_decode in his php files to solve this? Ashley Sheridan a...@ashleysheridan.co.uk escreveu na mensagem news:1253101315.2275.4.ca...@localhost... On Wed, 2009-09-16 at 17:00 +0530, Samrat Kar

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
I don't recall him saying that a utf8 table was not an option or that he wasn't using one. I know 'cause he replied directly to me rather than this ML Also, try not to top post ;) I usually hate scroll 'till the end to find often a single row as reply ... I'll try though Thanks,

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
If he´s really using a any other charset instead of utf8 table, why not using utf8_decode and utf8_decode in his php files to solve this? let's say PHP could have a different charset than the one defined in that MySQL table so this is not a portable solution, specially if you do not

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Ashley Sheridan
On Wed, 2009-09-16 at 15:40 +0200, Andrea Giammarchi wrote: I don't recall him saying that a utf8 table was not an option or that he wasn't using one. I know 'cause he replied directly to me rather than this ML Also, try not to top post ;) I usually hate scroll 'till the end to

Re: [PHP] php/mysql Query Question.

2009-09-16 Thread admin
I tend to do this robert, while looking at your example i thought to myself since i am trying to mimick a shell command why not run one. Result: ? $db = 'db'; $host = 'host'; $user = 'user'; $pass = 'pass'; $query = select * from $db.my_table; $ddvery = shell_exec(mysql -u$user -p$pass --html

RE: [PHP] Insert Symbol into Mysql

2009-09-16 Thread Andrea Giammarchi
Yeah, the rules say to snip out parts of the convo which aren't pertinent, but I know I don't exactly follow that one either! :-/ Thanks, Ash http://www.ashleysheridan.co.uk to be honest the problem is that I am in hotmail rather than gmail here, and this page is not clever as gmail one

Re: [PHP] php/mysql Query Question.

2009-09-16 Thread Robert Cummings
ad...@buskirkgraphics.com wrote: I tend to do this robert, while looking at your example i thought to myself since i am trying to mimick a shell command why not run one. Result: ? $db = 'db'; $host = 'host'; $user = 'user'; $pass = 'pass'; $query = select * from $db.my_table; $ddvery =

Re: [PHP] php/mysql Query Question.

2009-09-16 Thread Jim Lucas
ad...@buskirkgraphics.com wrote: Before most of you go on a rampage of how to please read below... As most of you already know when using MySQL from the shell you can write your queries in html format in an out file. Example: shellmysql -uyourmom -plovesme --html This now will return

Re: [PHP] APC - Upload progress problem. apc

2009-09-16 Thread Phred White
He's back... Well folks.. The good news is that APC and my upload progress is working! : ) The bad news is, ...kind of working. : | It does exactly what I want, but at 1 hour of progress-barring, it stops. I.e., APC stops returning a response for the given key. Whether the connection

Re: [PHP] APC - Upload progress problem. apc

2009-09-16 Thread Jim Lucas
Phred White wrote: He's back... Well folks.. The good news is that APC and my upload progress is working! : ) The bad news is, ...kind of working. : | It does exactly what I want, but at 1 hour of progress-barring, it stops. I.e., APC stops returning a response for the given key.

Re: [PHP] APC - Upload progress problem. apc

2009-09-16 Thread Ben Dunlap
upload keys, and any keys created via apc_add(). This listing includes a Timeout value, which is none for the apc_add keys and 3600 for the upload keys. Somewhat suspicious, I'd say, since the keys stop being working after 1 hour of use. APC lets you set a number of timeout values: