Re: [PHP-DB] Japanese characters.

2004-02-16 Thread Juan Torres
Thanks very much,

this extension is very good. Now i can work with unicode fields in my db.

Again thanks,
Juan Torres.

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



[PHP-DB] - Resizeing Images stored in mysql db

2004-02-16 Thread Nikos Gatsis
Hello list

I store images in a mysql table and use then in a web site.

Is possible to change the size of these images;


Following the code I'm allredy use.

 $query=SELECT photoxl FROM books WHERE books_id = '$books_id';
 $result=mysql_db_query($database, $query, $conn) or Die
(mysql_error());
 list($photoxl)=mysql_fetch_row($result);
 $type = $photoxl_type;
 if (!empty($photoxl)) {
  header(Content-Type: {$type});
  echo $photoxl;
 }

Thank you  in advance

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



Re: [PHP-DB] - Resizeing Images stored in mysql db

2004-02-16 Thread Nikos Gatsis
Thanx
but, first I dont know the real size of the stored pictures and second I
dont think that is a good idea to shrink a 50k photo.

- Original Message - 
From: Frisley Velasquez [EMAIL PROTECTED]
To: Nikos Gatsis [EMAIL PROTECTED]
Sent: Monday, February 16, 2004 4:16 PM
Subject: Re: [PHP-DB] - Resizeing Images stored in mysql db


 Hi, the only thing you need to do, is to add a varible where you specify
the
 width and the height of the pics. then add the var in the query. This to
be
 parsed not just as a img src=.. but as img src=... width=...
 height=..., so your images will be the width and height you want.

 Or if you would like dif. sizes, add a column in the table so you can
enter
 the width and height of each one, so you can call this ones(width and
 height) in each case.

 - Original Message -
 From: Nikos Gatsis [EMAIL PROTECTED]
 To: PHP-mailist [EMAIL PROTECTED]
 Sent: Monday, February 16, 2004 6:56 AM
 Subject: [PHP-DB] - Resizeing Images stored in mysql db


  Hello list
 
  I store images in a mysql table and use then in a web site.
 
  Is possible to change the size of these images;
 
 
  Following the code I'm allredy use.
 
   $query=SELECT photoxl FROM books WHERE books_id = '$books_id';
   $result=mysql_db_query($database, $query, $conn) or Die
  (mysql_error());
   list($photoxl)=mysql_fetch_row($result);
   $type = $photoxl_type;
   if (!empty($photoxl)) {
header(Content-Type: {$type});
echo $photoxl;
   }
 
  Thank you  in advance
 
  --
  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] - Resizeing Images stored in mysql db

2004-02-16 Thread Ricardo Lopes
To know the size of the images you could use a library like GD or something
like that.

You can also store one big image in your database and use the graphics
library to create a temporary image that will be send to the client with the
size / scale you want to send to the client. This way your 50k or 5000k
image will be used to create a small image ~5k that will be send to the
client.

Hope this helps

- Original Message -
From: Nikos Gatsis [EMAIL PROTECTED]
To: PHP-mailist [EMAIL PROTECTED]
Sent: Monday, February 16, 2004 2:23 PM
Subject: Re: [PHP-DB] - Resizeing Images stored in mysql db


 Thanx
 but, first I dont know the real size of the stored pictures and second I
 dont think that is a good idea to shrink a 50k photo.

 - Original Message -
 From: Frisley Velasquez [EMAIL PROTECTED]
 To: Nikos Gatsis [EMAIL PROTECTED]
 Sent: Monday, February 16, 2004 4:16 PM
 Subject: Re: [PHP-DB] - Resizeing Images stored in mysql db


  Hi, the only thing you need to do, is to add a varible where you specify
 the
  width and the height of the pics. then add the var in the query. This to
 be
  parsed not just as a img src=.. but as img src=... width=...
  height=..., so your images will be the width and height you want.
 
  Or if you would like dif. sizes, add a column in the table so you can
 enter
  the width and height of each one, so you can call this ones(width and
  height) in each case.
 
  - Original Message -
  From: Nikos Gatsis [EMAIL PROTECTED]
  To: PHP-mailist [EMAIL PROTECTED]
  Sent: Monday, February 16, 2004 6:56 AM
  Subject: [PHP-DB] - Resizeing Images stored in mysql db
 
 
   Hello list
  
   I store images in a mysql table and use then in a web site.
  
   Is possible to change the size of these images;
  
  
   Following the code I'm allredy use.
  
$query=SELECT photoxl FROM books WHERE books_id = '$books_id';
$result=mysql_db_query($database, $query, $conn) or Die
   (mysql_error());
list($photoxl)=mysql_fetch_row($result);
$type = $photoxl_type;
if (!empty($photoxl)) {
 header(Content-Type: {$type});
 echo $photoxl;
}
  
   Thank you  in advance
  
   --
   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



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



[PHP-DB] problems with spam

2004-02-16 Thread mayo
Has anybody else been getting spammed with penis and breast enlargeners to
their listserv email?

I use [EMAIL PROTECTED] solely for listservs and in the past week I've
started getting 5-10 spams a day.

Gil Midonnet

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



[PHP-DB] Extracting varable number of elements in a query to named arrays

2004-02-16 Thread John
I have a SELECT query with a variable number of fields being included.  When
I come to extract them I get the wrong result with the following type of
code as it does not 'accordian down' the list of variables - $a $b etc -
which I equate to the named array I am trying to extract:

while(list($a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l, $m, $n, $o, $p,
$q, $r)=mysql_fetch_array($result)) {
  $erefs[$z]=$a;
  $owners[$z]=$b;
  $addresss[$z]=$c;
  $contacts[$z]=$d;


Eg if I don't look for 'owners' in the query I end up with $b being the
addresses so that $addresss[$z]=$c; is a mismatch.  Is there an entirely
more adaptable way to extract the result into pre-defined array names with a
variable number of fields in the query?

Thanks,

John

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



Re: [PHP-DB] Extracting varable number of elements in a query to named arrays

2004-02-16 Thread Stuart
John wrote:
addresses so that $addresss[$z]=$c; is a mismatch.  Is there an entirely
more adaptable way to extract the result into pre-defined array names with a
variable number of fields in the query?
I think you're looking for http://php.net/mysql_fetch_assoc

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


Re: [PHP-DB] - Resizeing Images stored in mysql db

2004-02-16 Thread Nikos Gatsis
Thank you Recardo
Is possible to know the dimensions (x, y) of the stored image?

I try ImageCreateFromJPEG($mystoredpict) and ImagesX($mystoredpict) but
dosen't work

- Original Message - 
From: Ricardo Lopes [EMAIL PROTECTED]
To: Nikos Gatsis [EMAIL PROTECTED]
Cc: PHP DB [EMAIL PROTECTED]
Sent: Monday, February 16, 2004 4:41 PM
Subject: Re: [PHP-DB] - Resizeing Images stored in mysql db


 To know the size of the images you could use a library like GD or
something
 like that.

 You can also store one big image in your database and use the graphics
 library to create a temporary image that will be send to the client with
the
 size / scale you want to send to the client. This way your 50k or 5000k
 image will be used to create a small image ~5k that will be send to the
 client.

 Hope this helps

 - Original Message -
 From: Nikos Gatsis [EMAIL PROTECTED]
 To: PHP-mailist [EMAIL PROTECTED]
 Sent: Monday, February 16, 2004 2:23 PM
 Subject: Re: [PHP-DB] - Resizeing Images stored in mysql db


  Thanx
  but, first I dont know the real size of the stored pictures and second I
  dont think that is a good idea to shrink a 50k photo.
 
  - Original Message -
  From: Frisley Velasquez [EMAIL PROTECTED]
  To: Nikos Gatsis [EMAIL PROTECTED]
  Sent: Monday, February 16, 2004 4:16 PM
  Subject: Re: [PHP-DB] - Resizeing Images stored in mysql db
 
 
   Hi, the only thing you need to do, is to add a varible where you
specify
  the
   width and the height of the pics. then add the var in the query. This
to
  be
   parsed not just as a img src=.. but as img src=... width=...
   height=..., so your images will be the width and height you want.
  
   Or if you would like dif. sizes, add a column in the table so you can
  enter
   the width and height of each one, so you can call this ones(width and
   height) in each case.
  
   - Original Message -
   From: Nikos Gatsis [EMAIL PROTECTED]
   To: PHP-mailist [EMAIL PROTECTED]
   Sent: Monday, February 16, 2004 6:56 AM
   Subject: [PHP-DB] - Resizeing Images stored in mysql db
  
  
Hello list
   
I store images in a mysql table and use then in a web site.
   
Is possible to change the size of these images;
   
   
Following the code I'm allredy use.
   
 $query=SELECT photoxl FROM books WHERE books_id = '$books_id';
 $result=mysql_db_query($database, $query, $conn) or Die
(mysql_error());
 list($photoxl)=mysql_fetch_row($result);
 $type = $photoxl_type;
 if (!empty($photoxl)) {
  header(Content-Type: {$type});
  echo $photoxl;
 }
   
Thank you  in advance
   
--
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
 
 

 -- 
 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] - Resizeing Images stored in mysql db

2004-02-16 Thread Ricardo Lopes
I havent used GD but i know it can make that, try:
- the other mailing list you will get help.
- read the docs (phpmanual)

- you could use the pear package ImageTransform it looks like what you want
:) http://www.pear.php.net/package/Image_Transform

Here is the description of the package:

---
This package was written to provide a simpler and cross-library interface to
doing image transformations and manipulations.
It provides :

* support for GD, ImageMagick, Imagick and NetPBM
* files related functions
* addText
* Scale (by length, percentage, maximum X/Y)
* Resize
* Rotate (custom angle)
* Add border (soon)
* Add shadow (soon)

- Original Message -
From: Nikos Gatsis [EMAIL PROTECTED]
To: PHP-mailist [EMAIL PROTECTED]
Sent: Monday, February 16, 2004 3:36 PM
Subject: Re: [PHP-DB] - Resizeing Images stored in mysql db


 Thank you Recardo
 Is possible to know the dimensions (x, y) of the stored image?

 I try ImageCreateFromJPEG($mystoredpict) and ImagesX($mystoredpict) but
 dosen't work

 - Original Message -
 From: Ricardo Lopes [EMAIL PROTECTED]
 To: Nikos Gatsis [EMAIL PROTECTED]
 Cc: PHP DB [EMAIL PROTECTED]
 Sent: Monday, February 16, 2004 4:41 PM
 Subject: Re: [PHP-DB] - Resizeing Images stored in mysql db


  To know the size of the images you could use a library like GD or
 something
  like that.
 
  You can also store one big image in your database and use the graphics
  library to create a temporary image that will be send to the client with
 the
  size / scale you want to send to the client. This way your 50k or 5000k
  image will be used to create a small image ~5k that will be send to the
  client.
 
  Hope this helps
 
  - Original Message -
  From: Nikos Gatsis [EMAIL PROTECTED]
  To: PHP-mailist [EMAIL PROTECTED]
  Sent: Monday, February 16, 2004 2:23 PM
  Subject: Re: [PHP-DB] - Resizeing Images stored in mysql db
 
 
   Thanx
   but, first I dont know the real size of the stored pictures and second
I
   dont think that is a good idea to shrink a 50k photo.
  
   - Original Message -
   From: Frisley Velasquez [EMAIL PROTECTED]
   To: Nikos Gatsis [EMAIL PROTECTED]
   Sent: Monday, February 16, 2004 4:16 PM
   Subject: Re: [PHP-DB] - Resizeing Images stored in mysql db
  
  
Hi, the only thing you need to do, is to add a varible where you
 specify
   the
width and the height of the pics. then add the var in the query.
This
 to
   be
parsed not just as a img src=.. but as img src=...
width=...
height=..., so your images will be the width and height you want.
   
Or if you would like dif. sizes, add a column in the table so you
can
   enter
the width and height of each one, so you can call this ones(width
and
height) in each case.
   
- Original Message -
From: Nikos Gatsis [EMAIL PROTECTED]
To: PHP-mailist [EMAIL PROTECTED]
Sent: Monday, February 16, 2004 6:56 AM
Subject: [PHP-DB] - Resizeing Images stored in mysql db
   
   
 Hello list

 I store images in a mysql table and use then in a web site.

 Is possible to change the size of these images;


 Following the code I'm allredy use.

  $query=SELECT photoxl FROM books WHERE books_id = '$books_id';
  $result=mysql_db_query($database, $query, $conn) or Die
 (mysql_error());
  list($photoxl)=mysql_fetch_row($result);
  $type = $photoxl_type;
  if (!empty($photoxl)) {
   header(Content-Type: {$type});
   echo $photoxl;
  }

 Thank you  in advance

 --
 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
  
  
 
  --
  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



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



[PHP-DB] Storing files in database using ODBC

2004-02-16 Thread Markus Müller
Hi,

I'm trying to store an image - getting by HTTP-Post - in a Sybase
iAnywhere-Database.

I'm using the Unified ODBC functions to connect to the database.

The following function should store the image-file:

function ab_insert_file ( $connection_id, $document_id)
{
if ($_FILES['FILE']['size']  0 )
{
//move_uploaded_file($_FILES['FILE']['tmp_name'],'c:\tmp\file1.gif'); //
just tried, if the upload works
$mime_type = 'IMAGE/GIF';
$fhandle = fopen($_FILES['FILE']['tmp_name'],'r');
$blob_data = fread($fhandle, filesize($_FILES['FILE']['tmp_name']));
$data = bin2hex( $blob_data );
$insert = insert into document_file
(document_id, filename, data, file_date, mime_type) 
values
($document_id, '.$_FILES['FILE']['name'].', 
0x.$data., NULL,
'$mime_type');
ab_insert_db($connection_id, $insert); // function for inserting the
statement
}
}

The fileupload works fine. But if i try to face the image, I only get some
fragments of it (the first part, only).

The output-function reads as follows:

?php
$select = select data, mime_type from document_file where document_file_id
= $document_file_id;
$Query_ID = odbc_exec($connection_id, $select);
// change to ODBC_BINMODE_CONVERT for comparison
odbc_binmode($Query_ID, ODBC_BINMODE_RETURN);
$Images = odbc_result($Query_ID, 1);
echo $Images;
?

Any Idea?

Thanks :-))

Markus

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



[PHP-DB] Problem with cookies

2004-02-16 Thread Ruprecht Helms
Hi,

I've some trouble with the handling of cookies. At the command setcookie I get a 
warning that the header is already set. How can I fix the problem.

Regards,
Ruprecht
Ruprecht Helms IT-Service  Softwareentwicklung

Tel./Fax +49[0]7621 16 99 16

Web:  http://www.rheyn.de
email:[EMAIL PROTECTED]


The following section of this message contains a file attachment
prepared for transmission using the Internet MIME message format.
If you are using Pegasus Mail, or any other MIME-compliant system,
you should be able to save it or view it from within your mailer.
If you cannot, please ask your system administrator for assistance.

    File information ---
 File:  basket_add.php
 Date:  16 Feb 2004, 16:52
 Size:  4996 bytes.
 Type:  Unknown

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

RE: [PHP-DB] Problem with cookies

2004-02-16 Thread Hutchins, Richard
Normally, you get that warning when you've already sent display information
to the browser before you attempt to use the header() function. You need to
make sure you haven't sent ANY HTML to the browser prior to the header()
line in your code. You can check the PHP documentation regarding the
header() function.

Hard to tell without seeing your code though.

HTH,
Rich

 -Original Message-
 From: Ruprecht Helms [mailto:[EMAIL PROTECTED]
 Sent: Monday, February 16, 2004 1:00 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Problem with cookies
 
 
 Hi,
 
 I've some trouble with the handling of cookies. At the 
 command setcookie I get a 
 warning that the header is already set. How can I fix the problem.
 
 Regards,
 Ruprecht--
 --
 Ruprecht Helms IT-Service  Softwareentwicklung
 
 Tel./Fax +49[0]7621 16 99 16
 
 Web:  http://www.rheyn.de
 email:[EMAIL PROTECTED]
 
 
 

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



[PHP-DB] Brick Codes

2004-02-16 Thread Shaun
Hi,

I have a table of Locations around the country. My system produces reports
based on these Locations. I also have a table containing Brick Codes e.g.

BrickPost Code
AB51AB51
AB52AB52
AB55AB55
AB56AB56
AL01AL1
AL02AL2
AL03AL3
AL04AL4


How can I compare the first 3 or 4 letters of the postcode in the Locations
table to the corresponding entry in the Brick Codes table so I can add it to
my report?

Thanks for your help

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



[PHP-DB] sql, grouping problem

2004-02-16 Thread mayo
I'm trying to group the output of a query.
I can do it with cold fusion but cannot figure it out using php.

Currently I display a list of classes:

  +--+--++
  | CLASS TITLE  | LOCATION | CLASS CODE |
  +--+--++
  | CLASS DESCRIPTION br/br/ |
  | CLASS INSTRUCTOR br/br/  |
  | CLASS TIME   |
  +--+
 
 
  Now, things are getting a little more complicated.  Each
  class is going to have sections. So the display will be:
 
  CLASS TITLE
  CLASS DESCRIPTION
 
  CLASS CODE : CLASS SECTION .. LOCATION .. CLASS TIME .. INSTRUCTOR
 
  example below
 
  +-+
  | INTRO TO AAA|
  +-+
  | This is a really interesting    |
  | |
  +-+-+++
  |HT-111:A | NYC | 12:00-4:00 | Albert Alkin   |
  |HT-111:B | JC  | 2:00-6:00  | Bob Bailey |
  |HT-111:C | BX  | 4:00-8:00  | Chris Cawley   |
  +-+-+++
 
 cold fusion allows you to group output (see below)


  Select c.classId, c.classTexts, c.classDescription,
  cc.classCodeSection, cc.classDate, cc.classTime,
  cc.classLocation, cc.classInstructor
  FROM CLASSES c, CLASSCODES cc
  WHERE c.classId = cc.classId
  AND ...
  ORDER BY c.classId, ...

  cfoutput query=myQuery group=classId
#classTitle#
#classDescription#br...
  cfoutput
  
#classCodeSection#br
#classDate#br
#classTime#br

  /cfoutput
  /cfoutput

I can't figure out how to do this in php.

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



Re: [PHP-DB] sql, grouping problem

2004-02-16 Thread John W. Holmes
mayo wrote:

 cold fusion allows you to group output (see below)

  Select c.classId, c.classTexts, c.classDescription,
  cc.classCodeSection, cc.classDate, cc.classTime,
  cc.classLocation, cc.classInstructor
  FROM CLASSES c, CLASSCODES cc
  WHERE c.classId = cc.classId
  AND ...
  ORDER BY c.classId, ...
  cfoutput query=myQuery group=classId
  	#classTitle#
  	#classDescription#br...
  cfoutput
  
#classCodeSection#br
#classDate#br
#classTime#br

  /cfoutput
  /cfoutput
I can't figure out how to do this in php.
You just have to remember the value of the classID as you loop through 
the results, and only show the header row when the classID changes.

//Empty classID
$old_classID = '';
//Loop through results
while($row = mysql_fetch_assoc($result))
{
  //show title and description when
  //classID changes
  if($row['classID'] != $old_classID)
  {
echo trtd colspan=\3\{$row['title']}/td/tr;
echo trtd colspan=\3\{$row['description']}/td/tr;
$old_classID = $row['classID'];
  }
  //show rest of data
  echo trtd{$row['code']}/td;
  echo td{$row['section']}/td;
  echo td{$row['location']}/td/tr;
}
The logic is that the title and description rows are only shown when 
classID changes in the result set. I showed it using MySQL functions, 
but that can apply to any database/abstraction layer you've got running.

Hope that helps.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


Re: [PHP-DB] PHP and php_mssql.dll

2004-02-16 Thread Steve
Frank M. Kromann wrote:
You need to install the MSSQL Client Tools or alt least copy ntwdblib.dll
from the SQL Server (this will allow connections but not configuration).
- Frank


I have the php_mssql.dll in the extension directory but when I execute a


 PHP page, I am told that the dll does not exist.  This is on Windows 
XP Professional.

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


ntwdblib.dll is installed on the Server.

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