Re: [PHP-DB] Storing 4KB jpeg images on hospital web server

2007-03-07 Thread Chetan Graham
> Chetan Graham wrote:
>> Hi to All,
>>
>> There is a page on our hospitals website where a patient can look at the
>> choice of different doctors with their credentials, publications,
>> hobbies,
>> etc.Each doctor has or will have a 3-4KB jpeg image as well.
>>
>> We are using MySQL5.0.2.7 with PHP5.2.1
>> My question concerns the following:
>> The existing table's fields with one for the image:
>>
>> TABLE finddoc
>> id-int,not null, auto inc., unsigned,
>> name varchar(25),
>> desig varchar(30),
>> dept varchar(20),
>> email varchar(50),
>> image varchar(6000),
>> qualification varchar(100),
>> publications longtext,
>> areaofinterest longtext, not null,
>> achievements longtext not null,
>>
>> My job is to develop a page where a admin user can create and edit
>> existing doctor profiles. My question is about the image uploading part.
>> I have a feeling the one field given to me for images is quite limited.
>> Would it not be better to add another table with all the image info.
>> such
>> as the following?
>>
>> CREATE TABLE image (
>> image_id int(10) unsigned NOT NULL auto_increment,
>> image_type varchar(50) NOT NULL default '',
>> image longblob NOT NULL,
>> image_size bigint(20) NOT NULL default '0',
>> image_name varchar(255) NOT NULL default '',
>> image_date datetime NOT NULL default '-00-00 00:00:00',
>> UNIQUE KEY image_id (image_id)
>> );
>>
>> This will give greater control of the images or better manipulation of
>> data.
>> If it is recommended by you php/mysql higher souls to add a table such
>> as
>> this.  Then I have more questions.  Or perhaps the existing table is
>> fine.
>> One might guess I inherited this project.
>
> Do you need to store the image in the database (either for security
> reasons or something like replication) ?
>***Chetan writes:Actually the DB table 'finddoc' holds data for all
fields except the 'image' field.  In this field, right now,  it only
holds the reference to the web folder where the images are stored. All
the doctors images are in the same folder.  The problem is my job is to
bring all the profiles up to the current level of doctors in the
hospital.  We have close to 300 doctors right now working.

This is the reason I was thinking of actually putting the images in the
DB.  However, whatever is easier and just as effective.  Please let me
know if this has any bearing on your unexpected and excellent observation
of using the web server's file folders.  You might want to check out the
web site as it is now.  Only a small percentage of the doctors are listed
and not many photo's at all.


http://www.aimshospital.org/findadoc/find-a-doctor.php?id=47

>
> Maybe it would be easier to store them in a folder for each doctor on
> the server directly rather than in the DB.
>
> eg create a doctor_images/{doctor_id}/ folder and upload the images
> there.. then you don't have to worry about the db etc.
>
> --Thank you for your quick and to the point reply. I have something to
consider an about face in the design!  Chetan
> Postgresql & php tutorials
> http://www.designmagick.com/
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Storing 4KB jpeg images on hospital web server

2007-03-07 Thread Bastien Koert
best sore the image on the filesystem and use that field to store the path 
and image name. Its simpler to manage


Bastien



From: "Chetan Graham" <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Subject: [PHP-DB] Storing 4KB jpeg images on hospital web server
Date: Thu, 8 Mar 2007 07:06:39 +0300 (EAT)

Hi to All,

There is a page on our hospitals website where a patient can look at the
choice of different doctors with their credentials, publications, hobbies,
etc.Each doctor has or will have a 3-4KB jpeg image as well.

We are using MySQL5.0.2.7 with PHP5.2.1
My question concerns the following:
The existing table's fields with one for the image:

TABLE finddoc
id-int,not null, auto inc., unsigned,
name varchar(25),
desig varchar(30),
dept varchar(20),
email varchar(50),
image varchar(6000),
qualification varchar(100),
publications longtext,
areaofinterest longtext, not null,
achievements longtext not null,

My job is to develop a page where a admin user can create and edit
existing doctor profiles. My question is about the image uploading part.
I have a feeling the one field given to me for images is quite limited.
Would it not be better to add another table with all the image info. such
as the following?

CREATE TABLE image (
image_id int(10) unsigned NOT NULL auto_increment,
image_type varchar(50) NOT NULL default '',
image longblob NOT NULL,
image_size bigint(20) NOT NULL default '0',
image_name varchar(255) NOT NULL default '',
image_date datetime NOT NULL default '-00-00 00:00:00',
UNIQUE KEY image_id (image_id)
);

This will give greater control of the images or better manipulation of 
data.

If it is recommended by you php/mysql higher souls to add a table such as
this.  Then I have more questions.  Or perhaps the existing table is fine.
One might guess I inherited this project.
Blessings,
Chetan

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



_
Win a trip for four to a concert anywhere in the world! 
http://www.mobilelivetour.ca/


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Storing 4KB jpeg images on hospital web server

2007-03-07 Thread Chris

Chetan Graham wrote:

Hi to All,

There is a page on our hospitals website where a patient can look at the
choice of different doctors with their credentials, publications, hobbies,
etc.Each doctor has or will have a 3-4KB jpeg image as well.

We are using MySQL5.0.2.7 with PHP5.2.1
My question concerns the following:
The existing table's fields with one for the image:

TABLE finddoc
id-int,not null, auto inc., unsigned,
name varchar(25),
desig varchar(30),
dept varchar(20),
email varchar(50),
image varchar(6000),
qualification varchar(100),
publications longtext,
areaofinterest longtext, not null,
achievements longtext not null,

My job is to develop a page where a admin user can create and edit
existing doctor profiles. My question is about the image uploading part.
I have a feeling the one field given to me for images is quite limited. 
Would it not be better to add another table with all the image info. such

as the following?

CREATE TABLE image (
image_id int(10) unsigned NOT NULL auto_increment,
image_type varchar(50) NOT NULL default '',
image longblob NOT NULL,
image_size bigint(20) NOT NULL default '0',
image_name varchar(255) NOT NULL default '',
image_date datetime NOT NULL default '-00-00 00:00:00',
UNIQUE KEY image_id (image_id)
);

This will give greater control of the images or better manipulation of data.
If it is recommended by you php/mysql higher souls to add a table such as
this.  Then I have more questions.  Or perhaps the existing table is fine.
One might guess I inherited this project.


Do you need to store the image in the database (either for security 
reasons or something like replication) ?


Maybe it would be easier to store them in a folder for each doctor on 
the server directly rather than in the DB.


eg create a doctor_images/{doctor_id}/ folder and upload the images 
there.. then you don't have to worry about the db etc.


--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Storing 4KB jpeg images on hospital web server

2007-03-07 Thread Chetan Graham
Hi to All,

There is a page on our hospitals website where a patient can look at the
choice of different doctors with their credentials, publications, hobbies,
etc.Each doctor has or will have a 3-4KB jpeg image as well.

We are using MySQL5.0.2.7 with PHP5.2.1
My question concerns the following:
The existing table's fields with one for the image:

TABLE finddoc
id-int,not null, auto inc., unsigned,
name varchar(25),
desig varchar(30),
dept varchar(20),
email varchar(50),
image varchar(6000),
qualification varchar(100),
publications longtext,
areaofinterest longtext, not null,
achievements longtext not null,

My job is to develop a page where a admin user can create and edit
existing doctor profiles. My question is about the image uploading part.
I have a feeling the one field given to me for images is quite limited. 
Would it not be better to add another table with all the image info. such
as the following?

CREATE TABLE image (
image_id int(10) unsigned NOT NULL auto_increment,
image_type varchar(50) NOT NULL default '',
image longblob NOT NULL,
image_size bigint(20) NOT NULL default '0',
image_name varchar(255) NOT NULL default '',
image_date datetime NOT NULL default '-00-00 00:00:00',
UNIQUE KEY image_id (image_id)
);

This will give greater control of the images or better manipulation of data.
If it is recommended by you php/mysql higher souls to add a table such as
this.  Then I have more questions.  Or perhaps the existing table is fine.
One might guess I inherited this project.
Blessings,
Chetan

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Re: curl

2007-03-07 Thread datsclark
The code works with that link, although I wasn't able to immediately 
download the file. I'm not sure whats up, but it isn't segfaulting.

I'm on PHP5.2.0 with  libcurl/7.14.0 OpenSSL/0.9.8d zlib/1.2.3

( Not sure what's up with the RBL, email here is a little screwy. )


"Ron Croonenberg" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hi,
>
> what version of php and curl are you using ?
>
> does your code work (without getting a segmentation fault) for this
>  link : https://doc.telin.nl/dscgi/ds.py/Get/File-29224  ?
>
> this is the code I am trying to use:
>
>$ch = curl_init();
>$timeout = 5; // set to zero for no timeout
>curl_setopt ($ch, CURLOPT_URL, $url2);
>curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
>curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
>$file_contents = curl_exec($ch);
>curl_close($ch);
>$lines = array();
>$lines = explode("\n", $file_contents);
>
>
> Ron
>
> btw:  I had to resend the msg because:
>- The following addresses had permanent fatal errors -
> <[EMAIL PROTECTED]>
> (reason: 550 Denied as you are on an RBL)
>
>
> uuuhhm   what is RBL ?  and why am I on it ?
>
> Ron
>
>
>
>
> datsclark wrote:
>> I found this class in the PHP documentation, and edited it a bit.  It 
>> works for me, getting the header and the body separately.   You may want 
>> to experiment with the "> up with.
>>
>> class CCurl {
>>  var $m_handle;
>>  var $m_header;
>>  var $m_body;
>>  var $m_info;
>>
>>  function CCurl($sUrl) {
>>   $this->m_handle = curl_init();
>>   curl_setopt($this->m_handle, CURLOPT_URL, $sUrl);
>>   return;
>>  }
>>
>>  function setOpt($sOpt, $sVal) {
>>   curl_setopt($this->m_handle, $sOpt, $sVal);
>>   return;
>>  }
>>
>>  function getHeader() {
>>   return $this->m_header;
>>  }
>>
>>  function execute() {
>>   $sResponse = curl_exec($this->m_handle);
>>   $this->m_body = substr($sResponse, strpos($sResponse, ">   $this->m_header = substr($sResponse, 0, -strlen($this->m_body));
>>   return $this->m_body;
>>  }
>>
>>  function getInfo() {
>>   return $this->m_info = curl_getinfo($this->m_handle);
>>  }
>>  function close() {
>>   curl_close($this->m_handle);
>>   return;
>>  }
>> }
>>
>> "Ron Croonenberg" <[EMAIL PROTECTED]> wrote in message 
>> news:[EMAIL PROTECTED]
>>> Hello,
>>>
>>> I am working on an app with php and MySQL  but I have a curl question if
>>> you don't mind.
>>>
>>> I need to check a url (from the db)  but I want the get  the header info
>>> first.  now what i want is exactly what "curl -I "http://"; 
>>> outputs.
>>>
>>> I am trying to write a php script that produces the same output, but it
>>> seems to break (that pesky segment fault again)
>>>
>>> any ideas ?
>>>
>>> thanks,
>>>
>>> Ron
>>>
>>>
>>>
>>>
>>> -- 
>>> =
>>> It's is not, it isn't ain't, and it's it's, not its, if you mean
>>> it is. If you don't, it's its. Then too, it's hers. It isn't
>>> her's. It isn't our's either. It's ours, and likewise yours and
>>> theirs.
>>>  -- Oxford Uni Press
>>> =
>>> Ron Croonenberg   |
>>>   | Phone: 1 765 658 4761
>>> Lab Instructor &  | Fax:   1 765 658 4732
>>> Technology Coordinator|
>>>   |
>>> Department of Computer Science| e-mail: [EMAIL PROTECTED]
>>> DePauw University |
>>> 275 Julian Science & Math Center  |
>>> 602 South College Ave.|
>>> Greencastle, IN  46135|
>>> =
>>> http://www.csc.depauw.edu/RonCroonenberg.html
>>> =
>>
>
> -- 
> =
>  It's is not, it isn't ain't, and it's it's, not its, if you mean
>  it is. If you don't, it's its. Then too, it's hers. It isn't
>  her's. It isn't our's either. It's ours, and likewise yours and
>  theirs.
>   -- Oxford Uni Press
> =
>  Ron Croonenberg   |
>| Phone: 1 765 658 4761
>  Lab Instructor &  | Fax:   1 765 658 4732
>  Technology Coordinator|
>|
>  Department of Computer Science| e-mail: [EMAIL PROTECTED]
>  DePauw University |
>  275 Julian Science & Math Center  |
>  602 South College Ave.|
>  Greencastle, IN  46135|
> =
>  http://www.csc.depauw.edu/RonCroonenberg.html
> = 

-- 
PHP Database Mailing List (http://www.php.net/)
To 

Re: [PHP-DB] Re: curl

2007-03-07 Thread Ron Croonenberg

Hi,

what version of php and curl are you using ?

does your code work (without getting a segmentation fault) for this
 link : https://doc.telin.nl/dscgi/ds.py/Get/File-29224  ?

this is the code I am trying to use:

   $ch = curl_init();
   $timeout = 5; // set to zero for no timeout
   curl_setopt ($ch, CURLOPT_URL, $url2);
   curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
   curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
   $file_contents = curl_exec($ch);
   curl_close($ch);
   $lines = array();
   $lines = explode("\n", $file_contents);


Ron

btw:  I had to resend the msg because:
   - The following addresses had permanent fatal errors -
<[EMAIL PROTECTED]>
(reason: 550 Denied as you are on an RBL)


uuuhhm   what is RBL ?  and why am I on it ?

Ron




datsclark wrote:
I found this class in the PHP documentation, and edited it a bit.  It works 
for me, getting the header and the body separately.   You may want to 
experiment with the "with.


class CCurl {
 var $m_handle;
 var $m_header;
 var $m_body;
 var $m_info;

 function CCurl($sUrl) {
  $this->m_handle = curl_init();
  curl_setopt($this->m_handle, CURLOPT_URL, $sUrl);
  return;
 }

 function setOpt($sOpt, $sVal) {
  curl_setopt($this->m_handle, $sOpt, $sVal);
  return;
 }

 function getHeader() {
  return $this->m_header;
 }

 function execute() {
  $sResponse = curl_exec($this->m_handle);
  $this->m_body = substr($sResponse, strpos($sResponse, "m_header = substr($sResponse, 0, -strlen($this->m_body));
  return $this->m_body;
 }

 function getInfo() {
  return $this->m_info = curl_getinfo($this->m_handle);
 }
 function close() {
  curl_close($this->m_handle);
  return;
 }
}

"Ron Croonenberg" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]

Hello,

I am working on an app with php and MySQL  but I have a curl question if
you don't mind.

I need to check a url (from the db)  but I want the get  the header info
first.  now what i want is exactly what "curl -I "http://"; 
outputs.


I am trying to write a php script that produces the same output, but it
seems to break (that pesky segment fault again)

any ideas ?

thanks,

Ron




--
=
It's is not, it isn't ain't, and it's it's, not its, if you mean
it is. If you don't, it's its. Then too, it's hers. It isn't
her's. It isn't our's either. It's ours, and likewise yours and
theirs.
 -- Oxford Uni Press
=
Ron Croonenberg   |
  | Phone: 1 765 658 4761
Lab Instructor &  | Fax:   1 765 658 4732
Technology Coordinator|
  |
Department of Computer Science| e-mail: [EMAIL PROTECTED]
DePauw University |
275 Julian Science & Math Center  |
602 South College Ave.|
Greencastle, IN  46135|
=
http://www.csc.depauw.edu/RonCroonenberg.html
= 




--
=
 It's is not, it isn't ain't, and it's it's, not its, if you mean
 it is. If you don't, it's its. Then too, it's hers. It isn't
 her's. It isn't our's either. It's ours, and likewise yours and
 theirs.
  -- Oxford Uni Press
=
 Ron Croonenberg   |
   | Phone: 1 765 658 4761
 Lab Instructor &  | Fax:   1 765 658 4732
 Technology Coordinator|
   |
 Department of Computer Science| e-mail: [EMAIL PROTECTED]
 DePauw University |
 275 Julian Science & Math Center  |
 602 South College Ave.|
 Greencastle, IN  46135|
=
 http://www.csc.depauw.edu/RonCroonenberg.html
=

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: curl

2007-03-07 Thread datsclark
I found this class in the PHP documentation, and edited it a bit.  It works 
for me, getting the header and the body separately.   You may want to 
experiment with the "m_handle = curl_init();
  curl_setopt($this->m_handle, CURLOPT_URL, $sUrl);
  return;
 }

 function setOpt($sOpt, $sVal) {
  curl_setopt($this->m_handle, $sOpt, $sVal);
  return;
 }

 function getHeader() {
  return $this->m_header;
 }

 function execute() {
  $sResponse = curl_exec($this->m_handle);
  $this->m_body = substr($sResponse, strpos($sResponse, "m_header = substr($sResponse, 0, -strlen($this->m_body));
  return $this->m_body;
 }

 function getInfo() {
  return $this->m_info = curl_getinfo($this->m_handle);
 }
 function close() {
  curl_close($this->m_handle);
  return;
 }
}

"Ron Croonenberg" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Hello,
>
> I am working on an app with php and MySQL  but I have a curl question if
> you don't mind.
>
> I need to check a url (from the db)  but I want the get  the header info
> first.  now what i want is exactly what "curl -I "http://"; 
> outputs.
>
> I am trying to write a php script that produces the same output, but it
> seems to break (that pesky segment fault again)
>
> any ideas ?
>
> thanks,
>
> Ron
>
>
>
>
> -- 
> =
> It's is not, it isn't ain't, and it's it's, not its, if you mean
> it is. If you don't, it's its. Then too, it's hers. It isn't
> her's. It isn't our's either. It's ours, and likewise yours and
> theirs.
>  -- Oxford Uni Press
> =
> Ron Croonenberg   |
>   | Phone: 1 765 658 4761
> Lab Instructor &  | Fax:   1 765 658 4732
> Technology Coordinator|
>   |
> Department of Computer Science| e-mail: [EMAIL PROTECTED]
> DePauw University |
> 275 Julian Science & Math Center  |
> 602 South College Ave.|
> Greencastle, IN  46135|
> =
> http://www.csc.depauw.edu/RonCroonenberg.html
> = 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



答复: [PHP-DB] Urgent! Installing PHP 4 on 6 4-bit machines

2007-03-07 Thread Jacob
Check if phpmyadmin has the same problem.

-邮件原件-
发件人: Niel Archer [mailto:Niel Archer] 代表 Niel Archer
发送时间: 2007年3月7日 19:58
收件人: php-db@lists.php.net
主题: Re: [PHP-DB] Urgent! Installing PHP 4 on 64-bit machines

Hi

I've only had MySQL 4.1 running on 64 bit windows and PHP 5.x, without
any real problems when used locally.  However, there seemed to be a
problem using the MySQL server via TCP/IP, hence the upgrade to native
64 bit version (v5.0), which was not desired at the time but seemed to
be the only fix we could find.


Niel

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Urgent! Installing PHP 4 on 64-bit machines

2007-03-07 Thread Niel Archer
Hi

I've only had MySQL 4.1 running on 64 bit windows and PHP 5.x, without
any real problems when used locally.  However, there seemed to be a
problem using the MySQL server via TCP/IP, hence the upgrade to native
64 bit version (v5.0), which was not desired at the time but seemed to
be the only fix we could find.


Niel

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] RE : [PHP-DB] Re: RE : Re: [PHP-DB] pg_escape_bytea missing despite Postgre v.7.4.14

2007-03-07 Thread Thomas Woerly
Not at all. No version number for Postgres there.

--- Chris <[EMAIL PROTECTED]> a écrit :

> Thomas Woerly wrote:
> > Hello,
> > 
> > Thanks for you reply. Yeah, sorry for the subjet, wrong manipulation from
> me.
> > 
> > With a phpinfo(), I have pgsql section. Is it ok ? My version of PHP is
> 4.4.2,
> > so this is ok too.
> > 
> > pgsql
> > 
> > PostgreSQL Support  enabled
> > Active Persistent Links 0
> > Active Links0
> > 
> > Directive   Local Value Master Value
> > pgsql.allow_persistent On   On
> > pgsql.auto_reset_persistent Off Off
> > pgsql.ignore_noticeOff  Off
> > pgsql.log_noticeOff Off
> > pgsql.max_links   Unlimited Unlimited
> > pgsql.max_persistentUnlimited   Unlimited
> 
> That looks fine. Does it give you a postgres version number there too?
> 
> -- 
> Postgresql & php tutorials
> http://www.designmagick.com/
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 






___ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur 
Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php