[PHP-DB] storing PDF in a database

2002-03-24 Thread Alain DESEINE

Hello,

For many different reasons, like security ans soùme other one, i need to 
store PDF files in a database.

- Does anybody have already do this ?
- What kind of field type should i use (image filed type ???) ?

I'm currently using an ASE 12 (64 bits) SYBASE server on a HP-UX 11.00 
(64 bits) box.

The application server is a linux server with apache and PHP.

Any feedback about doing somethin like this will be valuable ...

Many thanks for responses.

Best regards,

Alain DESEINE.


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




Re: [PHP-DB] Re: Again Select then update

2002-03-24 Thread Bill Morrow

On Sat, Mar 23, 2002 at 11:46:36PM -0800, Jen Downey wrote:
 Hi all again!
 
 As Bill Morrow stated (in a private e-mail) I needed to use SET name =
 \$update\; instead of SET name = $update;
 It has stopped giving the error but it isn't updating the table. Am I doing
 something wrong?
 line 4 shows print(your name is $name);  The user name is printed to the
 browser but it simply will not update the table.
 
 $query = SELECT name FROM users WHERE uid={$session[uid]};
 $ret = mysql_query($query);
 while(list($name) = mysql_fetch_row($ret))
 print (your name is $name);
 
 $update = $name;
 
 $query_update[name] = UPDATE my_items SET name = $update;
 $result = mysql_query($query_update[name])or die(Error: .mysql_error());
 

Is this your latest code? You still don't have quotes around $update, if so.

Nothing returned in the .mysql_error()?

Can you run the query by hand?

Bill

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




Re: [PHP-DB] storing PDF in a database

2002-03-24 Thread Jason Cox

You'd want to use a BLOB field to store it.  It would be stored as raw data
in the db.  For an example, go find a tutorial on how to store images in the
database.  It would work the same way.

Jason Cox

- Original Message -
From: Alain DESEINE [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 24, 2002 2:32 AM
Subject: [PHP-DB] storing PDF in a database


 Hello,

 For many different reasons, like security ans soùme other one, i need to
 store PDF files in a database.

 - Does anybody have already do this ?
 - What kind of field type should i use (image filed type ???) ?

 I'm currently using an ASE 12 (64 bits) SYBASE server on a HP-UX 11.00
 (64 bits) box.

 The application server is a linux server with apache and PHP.

 Any feedback about doing somethin like this will be valuable ...

 Many thanks for responses.

 Best regards,

 Alain DESEINE.


 --
 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] Getting date range from mySQL

2002-03-24 Thread Alvin Ang

Hi ppl,

I want to retrieve data from a transaction table using the date range, i
stored date in mmdd format, but when in Jan~Sep the date stored is
mdd only, now i want to search the database from a certain date range.
Can anyone advise me how to do it?

Thanks!

Alvin Ang


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




Re: [PHP-DB] Re: Again Select then update

2002-03-24 Thread Jen Downey

Hi Bill,

No it isn't the latest it is updated with the quotes  and slashes in the
script.
I have found that even if I put my name Jen as $update it still wont update
the table.

$update = Jen

There is no error and the script acts like it work fine without updating.
I just did a test.php script and ran it. It will print the user name but
still wont update the table.

This has me totally stumped.

Thanks
Jen


Bill Morrow [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Sat, Mar 23, 2002 at 11:46:36PM -0800, Jen Downey wrote:
  Hi all again!
 
  As Bill Morrow stated (in a private e-mail) I needed to use SET name =
  \$update\; instead of SET name = $update;
  It has stopped giving the error but it isn't updating the table. Am I
doing
  something wrong?
  line 4 shows print(your name is $name);  The user name is printed to
the
  browser but it simply will not update the table.
 
  $query = SELECT name FROM users WHERE uid={$session[uid]};
  $ret = mysql_query($query);
  while(list($name) = mysql_fetch_row($ret))
  print (your name is $name);
 
  $update = $name;
 
  $query_update[name] = UPDATE my_items SET name = $update;
  $result = mysql_query($query_update[name])or die(Error:
.mysql_error());
 

 Is this your latest code? You still don't have quotes around $update, if
so.

 Nothing returned in the .mysql_error()?

 Can you run the query by hand?

 Bill



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




[PHP-DB] Speed Up Code?

2002-03-24 Thread Jeff Oien

Here is some code I have for an index page of people who post
charts on the Web, kind of like Yahoo Photos or something.
It displays the album title, number of images and date of last
upload. The page takes about 5-6 seconds to load which is all
in the queries I'm sure. Is there a way I can make this more efficient?
http://www.webdesigns1.com/temp/code.txt
Jeff

--

$table_name = Chart_Users;
$sql = SELECT * FROM $table_name order by album_title;
$result = mysql_query($sql,$connection) or die( Couldn't execute query.);
//if(! $result = mysql_query($sql,$connection)) {
  //print(ERROR .mysql_errno().: .mysql_error().br\n$sqlbr\n);
//  }

while ($row = mysql_fetch_array($result)) {
$id = $row['id'];
$username = $row['username'];
$title1 = $row['album_title'];
$title = stripslashes($title1);

$sql1 = SELECT COUNT(*) FROM Chart_Files where id = '$id';
$result1 = mysql_query($sql1,$connection) or die( Couldn't execute 
query.);
//if(! $result = mysql_query($sql1,$connection)) {
//print(ERROR .mysql_errno().: .mysql_error().br\n$sqlbr\n);
//}
$count = mysql_result($result1,0,count(*));

$sql2 = SELECT date_format(date, '%b. %D, %Y') as 
date1 FROM Chart_Files where
id = '$id' order by photoid desc limit 1;
$result2 = mysql_query($sql2,$connection) or die( 
Couldn't execute query.);
$row = mysql_fetch_array($result2);
$date1 = $row['date1'];

if ($count  0) {

$display_block .= trtd nowrap align=\left\ba
href=\display_album.php?id=$id\$titlenbsp;/a/b/tdtd
align=\left\$count/tdtd align=\right\ nowrap$date1/td/tr;
}
}


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




[PHP-DB] update

2002-03-24 Thread Chris Payne

Hi there,

I have a system for updating whereby you select the country/continent from a db then 
edit the record and update it and it works perfectly - that is until there is a  in 
the update $country set - so if it says Africa it updates fine, but if $country = Asia 
 The Orient it doesn't update, any ideas how I can fix this?

Thanks everyone.

Chris



Re: [PHP-DB] update

2002-03-24 Thread Chris Payne

Looking at the below, I think it might be spaces in the query - how can I
rectify this?  Thanks :-)

Chris

Hi there,

I have a system for updating whereby you select the country/continent from a
db then edit the record and update it and it works perfectly - that is until
there is a  in the update $country set - so if it says Africa it updates
fine, but if $country = Asia  The Orient it doesn't update, any ideas how I
can fix this?

Thanks everyone.

Chris



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




Re: [PHP-DB] storing PDF in a database

2002-03-24 Thread Kevin Won

I have the same need for all sorts of doc types w/ m$ sql server. The wrox 
'professional sql server programming' talks about this issue of storing file type data 
in a table row briefly, leaving me disheartned. basically, the summation of the issue 
is it's a really bad idea performance wise--like it can bring the server down to its 
knees, because essentially (as I understand it) there is a 3 part method of 
abstraction where sql server actually puts your data into its own discreet file which 
is accessed via the sql server on a per-query basis. 

ouch.

This sorta contradicts the fuzzy marketing-type hype I've read elsewhere that suggests 
using the IMAGE data type to store .doc or .xls data with a full-text index to make it 
searchable.

I don't know if the sybase system has a comprable data type, but that would be the 
solution on the m$ side in theory, though in practice, the wrox book steers you away 
from putting documents in the rdbms.

I hope I'm wrong and someone else is doing this and can post a workable solution.

kevin

 Alain DESEINE [EMAIL PROTECTED] 03/24/02 05:36 AM 
Hello,

For many different reasons, like security ans soùme other one, i need to 
store PDF files in a database.

- Does anybody have already do this ?
- What kind of field type should i use (image filed type ???) ?

I'm currently using an ASE 12 (64 bits) SYBASE server on a HP-UX 11.00 
(64 bits) box.

The application server is a linux server with apache and PHP.

Any feedback about doing somethin like this will be valuable ...

Many thanks for responses.

Best regards,

Alain DESEINE.


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