OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 28 Dec 2006 22:54:35 -0000 Issue 4539

php-general-digest-helplists.php.net
Date: Thu Dec 28 2006 - 16:54:35 CST


php-general Digest 28 Dec 2006 22:54:35 -0000 Issue 4539

Topics (messages 246253 through 246261):

Re: GD 2.0.28 + PHP 4.4.2 + pixelation :(
        246253 by: zerof

reading MS Excel?
        246254 by: William Stokes
        246255 by: Leonard Burton
        246256 by: Miles Thompson
        246261 by: John Meyer

problem with mysql_real_escape_string()
        246257 by: afan.afan.net
        246258 by: Chris
        246259 by: Stut
        246260 by: afan.afan.net

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Steven Macintyre escreveu:
> Hi All,
>
> I have done some searching via google and some answers say change
> copyimageresampled to copyimageresized etc
>
> I have tried all fixes ... to no avail
>
>
> I have one image here 1280 x 960 (150 dpi) 24 depth
>
> When using the following it pixelates ...
>
> function createthumb($name,$filename,$new_w,$new_h)
----
http://www.educar.pro.br/abc/gdlib/
----
zerof

attached mail follows:


Is it possible to read Excel files and store the info to DB? If so how?

Thanks
-Will

attached mail follows:


On 12/28/06, Jiffy Slides Leonard Burton <servicejiffyslides.com> wrote:
> HI Will,
>
> > Is it possible to read Excel files and store the info to DB? If so how?
>
> It is best (well depending on the application) to save the files as
> .csv and then use fgetcsv. it will allow you to parse each line and
> cell in the file and then go from there.
>
> Take Care,
>
> --
> Leonard Burton, N9URK
> leonardburtongmail.com
>
> "The prolonged evacuation would have dramatically affected the
> survivability of the occupants."
>

--
Leonard Burton, N9URK
leonardburtongmail.com

"The prolonged evacuation would have dramatically affected the
survivability of the occupants."

attached mail follows:


At 09:49 AM 12/28/2006, William Stokes wrote:

>Is it possible to read Excel files and store the info to DB? If so how?
>
>Thanks
>-Will

Yes - but rather than re-invent the wheel, google for "php read excel".

Your solution may be there. Once you have read the information, then the
rest is just an INSERT into the database.

Cheers - Miles

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.15.28/606 - Release Date: 12/28/2006

attached mail follows:


On a side note, but going on the basis that the users are uploading .xls
files and don't understand how to convert. Would it be better to use
php's routines or to automate excel, convert it inside there, and then
use the result?
Leonard Burton wrote:
> On 12/28/06, Jiffy Slides Leonard Burton <servicejiffyslides.com> wrote:
>> HI Will,
>>
>> > Is it possible to read Excel files and store the info to DB? If so how?
>>
>> It is best (well depending on the application) to save the files as
>> .csv and then use fgetcsv. it will allow you to parse each line and
>> cell in the file and then go from there.
>>
>> Take Care,
>>
>> --
>> Leonard Burton, N9URK
>> leonardburtongmail.com
>>
>> "The prolonged evacuation would have dramatically affected the
>> survivability of the occupants."
>>
>
>

attached mail follows:


Hi to all!

I moved my website from one php4/mysql4 based server to new hosting
company and php5/mysq5 based server.
Everything worked fine on old server, though now, on one page after I
submit new record, I'll get this error:

Warning: mysql_real_escape_string() [function.mysql-real-escape-string
<https://www.mydomain.com/function.mysql-real-escape-string>
]: Access denied for user 'daemon''localhost' (using password: NO) in
/srv/www/mydomain/add_record.php on line 30

Warning: mysql_real_escape_string() [function.mysql-real-escape-string
<https://www.mydomain.com/function.mysql-real-escape-string>
]: A link to the server could not be established in
/srv/www/mydomain.com/add_record.php on line 30

and this is a code:

26 if(isset($_POST['SubmitNewRecord']))
27 {
28 foreach($_POST as $key => $value)
29 {
30 ${$key} = mysql_real_escape_string($value);
31 }
32 }

Never got such a error message before.

Any thoughts?

Thanks.

-afan

attached mail follows:


You need to have established a database connection before using that
function, see manual.

<afanafan.net> wrote in message
news:4453.69.66.68.21.1167315072.squirrelafan.net...
> Hi to all!
>
> I moved my website from one php4/mysql4 based server to new hosting
> company and php5/mysq5 based server.
> Everything worked fine on old server, though now, on one page after I
> submit new record, I'll get this error:
>
> Warning: mysql_real_escape_string() [function.mysql-real-escape-string
> <https://www.mydomain.com/function.mysql-real-escape-string>
> ]: Access denied for user 'daemon''localhost' (using password: NO) in
> /srv/www/mydomain/add_record.php on line 30
>
> Warning: mysql_real_escape_string() [function.mysql-real-escape-string
> <https://www.mydomain.com/function.mysql-real-escape-string>
> ]: A link to the server could not be established in
> /srv/www/mydomain.com/add_record.php on line 30
>
> and this is a code:
>
> 26 if(isset($_POST['SubmitNewRecord']))
> 27 {
> 28 foreach($_POST as $key => $value)
> 29 {
> 30 ${$key} = mysql_real_escape_string($value);
> 31 }
> 32 }
>
> Never got such a error message before.
>
> Any thoughts?
>
> Thanks.
>
> -afan

attached mail follows:


afanafan.net wrote:
> I moved my website from one php4/mysql4 based server to new hosting
> company and php5/mysq5 based server.
> Everything worked fine on old server, though now, on one page after I
> submit new record, I'll get this error:
>
> Warning: mysql_real_escape_string() [function.mysql-real-escape-string
> <https://www.mydomain.com/function.mysql-real-escape-string>
> ]: Access denied for user 'daemon''localhost' (using password: NO) in
> /srv/www/mydomain/add_record.php on line 30
>
> Warning: mysql_real_escape_string() [function.mysql-real-escape-string
> <https://www.mydomain.com/function.mysql-real-escape-string>
> ]: A link to the server could not be established in
> /srv/www/mydomain.com/add_record.php on line 30
>
> and this is a code:
>
> 26 if(isset($_POST['SubmitNewRecord']))
> 27 {
> 28 foreach($_POST as $key => $value)
> 29 {
> 30 ${$key} = mysql_real_escape_string($value);
> 31 }
> 32 }
>
> Never got such a error message before.

Check the archives - this was asked a few days ago. The
mysql_real_escape_string function requires a connection to the database
to be open. If one isn't open it will try to open one with the defaults.
All you need to do is make sure you connect to the mysql database before
using mysql_real_escape_string.

-Stut

attached mail follows:


A little bit "lower" on php.net/manual I found explanation too.
I'm sorry for bothering - wasn't check whole page before posting. The
Warning was strange for me because never got it before
:)

Thanks for your help.

-afan

> afanafan.net wrote:
>> I moved my website from one php4/mysql4 based server to new hosting
>> company and php5/mysq5 based server.
>> Everything worked fine on old server, though now, on one page after I
>> submit new record, I'll get this error:
>>
>> Warning: mysql_real_escape_string() [function.mysql-real-escape-string
>> <https://www.mydomain.com/function.mysql-real-escape-string>
>> ]: Access denied for user 'daemon''localhost' (using password: NO) in
>> /srv/www/mydomain/add_record.php on line 30
>>
>> Warning: mysql_real_escape_string() [function.mysql-real-escape-string
>> <https://www.mydomain.com/function.mysql-real-escape-string>
>> ]: A link to the server could not be established in
>> /srv/www/mydomain.com/add_record.php on line 30
>>
>> and this is a code:
>>
>> 26 if(isset($_POST['SubmitNewRecord']))
>> 27 {
>> 28 foreach($_POST as $key => $value)
>> 29 {
>> 30 ${$key} = mysql_real_escape_string($value);
>> 31 }
>> 32 }
>>
>> Never got such a error message before.
>
> Check the archives - this was asked a few days ago. The
> mysql_real_escape_string function requires a connection to the database
> to be open. If one isn't open it will try to open one with the defaults.
> All you need to do is make sure you connect to the mysql database before
> using mysql_real_escape_string.
>
> -Stut
>