Re: [PHP-DB] oracle compilation with php

2004-01-07 Thread Christopher Jones
I see the answer has already been given on php-install.

A suggestion which hasn't been made is to use PHP's new oci8
interface in preference to the old one called oracle whenever
possible.
To quote from a note on Oracle's PHP forum (see
http://forums.oracle.com/forums/forum.jsp?forum=178 )
  There are several reasons why I'd want to use PHP's OCI8 instead of
  ora_ calls: better Oracle behavior, performance and support, ability
  to use LOBs, and perhaps OCI8 is more widely used with better PHP
  support and examples.
Chris

Douglas B. Jones wrote:

Hi,

(I also posted this to php-install this morning, but decided to
see if I might get some more help in this group - sorry for any
cross postings.)
We are on Tru64 5.1 and I am trying to compile php 4.3.4. I get
the following error:
cc: Severe: /src/net/www/php-4.3.4/ext/oracle/php_oracle.h, line 23: Cannot
find file ocidfn.h specified in #include directive. (noinclfilef)
#include ocidfn.h
-^
I cannot find this include file anywhere in the oracle installation
or the php installation. The oracle version is 9.2.0.1.0.
I have also try oci8, but no luck there either - it can't find oci.h.

Thanks for any help.
Cheers,
Douglas
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Re: [PHP] INSERT into mysql from dynamic drop down

2004-01-07 Thread Nitin Mehta

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 12:07 PM
Subject: [PHP] INSERT into mysql from dynamic drop down



 Hi all,

Right now i would like to INSERT the values from a dynamic drop
down
 menu into mysql database but encountered some problem here. Values in the
drop
 down menu are retrieved from DB as follows:

 SNIP

 SELECT NAME=tutor_name CLASS=textarea
 ?


 $sql = mysql_query(SELECT DISTINCT tutor_name FROM tutor);
 while ($row = mysql_fetch_array($sql))
 {
  print OPTION VALUE=\$tutor_name\  .$row[tutor_name]. /option;

change it to:
print OPTION VALUE=.$row['tutor_name'].  .$row[tutor_name].
/option;

hope that helps

  }
 $result = $db-query($sql);

 ?
 /SELECT

 /SNIP

 --
-

 echo $_POST[tutor_name];

 INSERT statement:

 $sql = INSERT INTO class (class_code, tutor_name, edu_level,
timetable_day,
 timetable_time)
 VALUES

('$class_code','$tutor_name','$edu_level','$timetable_day','$timetable_time'
);

 --
-

 I am trying to POST the values and then INSERT into DB but was not able to
do
 so(all other values eg. class_code, edu_level etc...was able to be
 INSERTED into DB but not tutor_name. So, how do i insert values into DB
from
 a dynamic drop down and where have i gone wrong???Hope to get some help
real
 soon.=)

 All help are greatly appreciated. Thanks in advance.


 Regards,
 Irin.

 -- 
 PHP General 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] Re: Need help retreiving one record

2004-01-07 Thread Bossek
you have to fetch results from query
use:
mysql_fetch_field
http://si2.php.net/manual/sl/function.mysql-fetch-field.php

Jeroen Wasteels [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I'm studying PHP now woth this manual, but it's rather fuzzy on how to
show
 data on screen obtained from a database, or how to assign a value of one
 record of the database to a variable I can use in my script.  Concrete,
this
 is the case: I would like to be able to assign to the variable
$TruePassword
 the value found in colomn Password at row $EneteredName, so I can compare
it
 to the password ppl enter when logging in.

 I hope this makes sense, if not please ask what I forgot to mention or
what
 I was unclear about.

 Thanks beforehand,
 Ondoron Bondoon

 btw, this is what I tried...
 ?php
 $Host=localhost;
 $Username=adminsithlore;
 $DBName=adminsithlore_uk_db;
 $Tablename=Login;
 $Connection = mysql_connect ($Host, $Username);
 $Mission= select Password from $Tablename where (Name=\Ondoron
 Bondoon\);
 $Result= mysql_db_query($DBName, $Mission, $Connection);
 if ($Result) {
 print ($Result);
 }

 print(br/ $tryname, $trypassword);
 mysql_close ($Connection);
 ?

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



RE: [PHP-DB] oracle compilation with php

2004-01-07 Thread Douglas B. Jones

I did not see an answer on php-install. I have also tried oci8,
but I get the error mentioned at the bottom of my post. I have
the ORA_HOME set, both on the shell level and the makefile level.
I look under the ORA_HOME root with 'find ORA_HOME -name oci.h
-print', and I get nothing. When I look for all headers, '*.h',
I get none of the ones missing for php oci8 or oracle options.
Thanks for the quote below, I will then want to look more to
the oci8 calls then. Unfortunately, neither oci8 or oracle php
option let me compile, due to the respective missing header files.

-Original Message-
From: Christopher Jones [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 07, 2004 1:58 AM
To: Douglas B. Jones
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] oracle compilation with php



I see the answer has already been given on php-install.

A suggestion which hasn't been made is to use PHP's new oci8
interface in preference to the old one called oracle whenever
possible.

To quote from a note on Oracle's PHP forum (see
http://forums.oracle.com/forums/forum.jsp?forum=178 )

   There are several reasons why I'd want to use PHP's OCI8 instead of
   ora_ calls: better Oracle behavior, performance and support, ability
   to use LOBs, and perhaps OCI8 is more widely used with better PHP
   support and examples.

Chris

Douglas B. Jones wrote:

 Hi,

 (I also posted this to php-install this morning, but decided to
 see if I might get some more help in this group - sorry for any
 cross postings.)

 We are on Tru64 5.1 and I am trying to compile php 4.3.4. I get
 the following error:

 cc: Severe: /src/net/www/php-4.3.4/ext/oracle/php_oracle.h, line 23:
Cannot
 find file ocidfn.h specified in #include directive. (noinclfilef)
 #include ocidfn.h
 -^

 I cannot find this include file anywhere in the oracle installation
 or the php installation. The oracle version is 9.2.0.1.0.

 I have also try oci8, but no luck there either - it can't find oci.h.

 Thanks for any help.
 Cheers,
 Douglas


--
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] inserting dynamic drop down menu data into mysql

2004-01-07 Thread Duane Barnes
I'm having a problem with a standard html form.  I'm using a php function to
populate a drop down menu on a standard form.  I want the contents of the
submitted form to insert into a mysql table. All of the variables are
inserted correctly except for the data from the drop down menu.  For some
reason it will only insert the first word in the variable.  It cuts off
everything after the frist word.  
 
Code:
 
html
head
titletest/title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
 
body bgcolor=#99
?
include(../includes/index.inc.php);
 
function build_dropdown() {
$sql = select category from categories ORDER BY category;
$result = mysql_query($sql) or DIE(mysql_error(). - .mysql_errno());

while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
extract($row);
$output .= option value=$category$category/option;
}
return $output;
}
?
div align=center
  table width=600 border=0 cellpadding=0 cellspacing=0
bgcolor=#FF
tr
  tdimg src=admin.jpg width=600 height=185/td
/tr
tr
  tdnbsp;/td
/tr
tr
  tdform name=form1 enctype=multipart/form-data method=post
action=add_company_submit.php
  div align=center
table width=99% border=0 cellspacing=0 cellpadding=0
tr
  td width=22%font size=2 face=Georgia, Times New Roman,
Times, serifCompany Name/font/td
  td width=78%input name=name type=text id=name/td
/tr
tr
  td width=22%font size=2 face=Georgia, Times New Roman,
Times, serifnbsp;/font/td
  tdnbsp;/td
/tr
tr
  td width=22%Company Category/td
  tdselect name=category type=text? echo
build_dropdown() ?
  /select
/td
/tr
tr
  tdnbsp;/td
  tdnbsp;/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifPhone Number/font/td
  tdinput name=number1 type=text id=number1/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifnbsp;/font/td
  tdnbsp;/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifToll Free Number/font/td
  tdinput name=number2 type=text/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifnbsp;/font/td
  tdnbsp;/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifFax Number/font/td
  tdinput name=fax type=text/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifnbsp;/font/td
  tdnbsp;/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifE-Mail Address/font/td
  tdinput name=email type=text/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifnbsp;/font/td
  tdnbsp;/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifWebsite Address/font/td
  tdinput name=web type=text/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifnbsp;/font/td
  tdnbsp;/td
/tr
tr
  tdfont size=2 face=Georgia, Times New Roman, Times,
serifCompany Image/font/td
  tdinput name=graphic type=file
/td
/tr
tr
  tdnbsp;/td
  tdnbsp;/td
/tr
tr
  tdnbsp;/td
  tdnbsp;/td
/tr
tr
  tdnbsp;/td
  tdinput type=submit name=Submit value=Submit
input type=reset name=Reset value=Reset/td
/tr
/table
  /div
  /form/td
/tr
  /table
/div
/body
/html
 

--
 
Submit File
 
?
$max_file_size = 500;
$input_error_string=;
$input_errors=0;
@$size = getimagesize ($graphic);
 
if ($graphic_size = $max_file_size)
{
  $input_errors++;
  $input_error_string = $input_error_string . $input_errors . . File too
largeBR;
}
if ($input_errors != 0) {
print centerfont face=verdana size=2 color=66;
printf(%s\n,$input_error_string);
print a href=add_company.phpbrClick here to try
again/a/font/center;
exit;
}
 
require(../includes/index.inc.php);
$sql_command=SELECT actname FROM businesses;
$db_recordset=mysql_query($sql_command);
$number=mysql_num_rows($db_recordset);
$i = 0;
$input_error_string=;
$input_errors=0;
WHILE ($i  $number):
 
$actpicname = mysql_result($db_recordset,$i,actname);
 
$i++;  
ENDWHILE;
 
if ($input_errors != 0) 
{
print centerfont 

RE: [PHP-DB] inserting dynamic drop down menu data into mysql

2004-01-07 Thread Ford, Mike [LSS]
On 07 January 2004 15:12, Duane Barnes contributed these pearls of wisdom:

 I'm having a problem with a standard html form.  I'm using a
 php function to
 populate a drop down menu on a standard form.  I want the
 contents of the
 submitted form to insert into a mysql table. All of the
 variables are inserted correctly except for the data from the
 drop down 
 menu.  For some
 reason it will only insert the first word in the variable.
 It cuts off
 everything after the frist word.

This sounds like an unquoted multi-word attribute problem.

[snip]

 function build_dropdown() {
 $sql = select category from categories ORDER BY category;
 $result = mysql_query($sql) or DIE(mysql_error(). -
 .mysql_errno()); 
 
 while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {   
 extract($row); $output .= option
 value=$category$category/option;

Yup, here it is -- quote the argument to the value= attribute, and everything should 
be hunky dorey.

Cheers!

Mike

-- 
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211

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



RE: [PHP-DB] INSERT into mysql from dynamic drop down

2004-01-07 Thread Aleks @ USA.net
Hello  Irin,

Not sure where you problem is but here is what I would check first.

After you open the page that has the drop down list, view the source and
See if the OPTION VALUE= has any value assigned to it. If you are using
IE, on the menu bar click on View - Source. 

Second, if that is fine, after you echo the value, you still need to either

1. set the value for $tutor_name in your sql statement - $tutor_name =
$_POST[tutor_name];
2. Change your sql statement - instead of $tutor_name, say

$sql = INSERT INTO class (class_code, tutor_name, edu_level, timetable_day,
timetable_time)
VALUES
('$class_code','$_POST[tutor_name]','$edu_level','$timetable_day','$timeta
ble_time');

You will have to play with the  and ' to get this right..
I would suggest option 1

Hope this helps..

Aleks

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 07, 2004 1:37 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP-DB] INSERT into mysql from dynamic drop down


Hi all, 

   Right now i would like to INSERT the values from a dynamic drop down
menu into mysql database but encountered some problem here. Values in the
drop down menu are retrieved from DB as follows:

SNIP

SELECT NAME=tutor_name CLASS=textarea ?


$sql = mysql_query(SELECT DISTINCT tutor_name FROM tutor); while ($row =
mysql_fetch_array($sql)) {  print OPTION VALUE=\$tutor_name\ 
.$row[tutor_name]. /option;  } $result = $db-query($sql);

?
/SELECT

/SNIP


---

echo $_POST[tutor_name];

INSERT statement:

$sql = INSERT INTO class (class_code, tutor_name, edu_level, timetable_day,
timetable_time)
VALUES
('$class_code','$tutor_name','$edu_level','$timetable_day','$timetable_time'
);


---

I am trying to POST the values and then INSERT into DB but was not able to
do so(all other values eg. class_code, edu_level etc...was able to be
INSERTED into DB but not tutor_name. So, how do i insert values into DB
from a dynamic drop down and where have i gone wrong???Hope to get some help
real
soon.=)

All help are greatly appreciated. Thanks in advance.


Regards,
Irin. 

--
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] confirm unsubscribe from php-db@lists.php.net

2004-01-07 Thread Cilfa
Hello list,

  

Greetings,

Cilfa

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



Re: [PHP-DB] inserting dynamic drop down menu data into mysql

2004-01-07 Thread CPT John W. Holmes
From: Duane Barnes [EMAIL PROTECTED]

 $output .= option value=$category$category/option;

Put quotes around your values...

If you have

option value=This and ThatThis and That/option

how do you expect HTML to know you mean This and That as you're entire
value? It's not. It's going to take This and ignore the rest as
unrecognized attributes of the option element.

---John Holmes...

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



Re: [PHP-DB] oracle compilation with php

2004-01-07 Thread Michael Mauch
Douglas B. Jones wrote:
 
 I did not see an answer on php-install.

http://lists.php.net/article.php?group=php.installarticle=12457

 I have also tried oci8,
 but I get the error mentioned at the bottom of my post. I have
 the ORA_HOME set, both on the shell level and the makefile level.

It's ORACLE_HOME, not ORA_HOME. You have to set and export it in the
shell.

 I look under the ORA_HOME root with 'find ORA_HOME -name oci.h
 -print', and I get nothing. When I look for all headers, '*.h',
 I get none of the ones missing for php oci8 or oracle options.
 Thanks for the quote below, I will then want to look more to
 the oci8 calls then. Unfortunately, neither oci8 or oracle php
 option let me compile, due to the respective missing header files.

Yes, Oracle's installer is fun.

Regards...
Michael

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



[PHP-DB] MySQL Insert

2004-01-07 Thread Will W
Hello Everyone,
Can anyone tell me how to insert a file, say a .doc, .txt or a .rtf file into a table 
from an upload form??

Thanks in advance,
~~Will~~


Re: [PHP-DB] MySQL Insert

2004-01-07 Thread ma
hi

there are several ways of saving the data within a file.
you can save it plain or binary. if you want to save a file in the db i
suggest using the field-type BLOB

short example:

to create the table:

CREATE TABLE `files` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`fileName` VARCHAR(255) NOT NULL,
`data` BLOB,
PRIMARY KEY (`id`)
) TYPE=MyISAM

the html-form:

form name=saveFile action=script.php method=post
enctype=multipart/form-data
File: input name=myFile type=file
input type=submit
/form

the php-script:

?php

$con = mysql_connect();
mysql_select_db();

if(isset($_FILES['myFile']) 
is_uploaded_file($_FILES['myFile']['tmp_name'])) {

$data = join('', file($_FILES['myFile']['tmp_name']));
$qry = 'INSERT INTO `files` (filename, data) VALUES
('.$_FILES['myFile']['name'].', '.$data.')';
mysql_query($qry, $con);

}

?

for further info gosee:
http://www.php.net/manual/en/features.file-upload.php


hth?

greetings -ma

# life would be easier, if i knew the source code...

 Von: Will W [EMAIL PROTECTED]
 Antworten an: [EMAIL PROTECTED]
 Datum: Wed, 7 Jan 2004 20:21:15 -0500
 An: PHP DB [EMAIL PROTECTED]
 Betreff: [PHP-DB] MySQL Insert
 
 Hello Everyone,
 Can anyone tell me how to insert a file, say a .doc, .txt or a .rtf file into
 a table from an upload form??
 
 Thanks in advance,
 ~~Will~~
 

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



Re2: [PHP-DB] MySQL Insert

2004-01-07 Thread ma
hi!

just to add:

use file() only if you run php 4.3.0 or higher.

if this is not the case use this syntax (its binary safe):

$fp = fopen($_FILES['myFile']['tmp_name'], 'r'); # on windows use 'rb'
instead of 'r'
$data = fread($fp, file_size($_FILES['myFile']['tmp_name']));
fclose($fp);

instead of $data = join(etc);

greets - ma

# life would be easier if i knew the source code...

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



[PHP-DB] Re: Need help retreiving one record

2004-01-07 Thread Jeroen Wasteels
I still can't see what exactly I'm supposed to do... could someone please
write me a little piece of code that enters colomn soandso row soandso and
then stores what's there in a variable that's ready to print or so? I copied
the example from php.net, changing of course names of databases and tables,
but I got nothing.

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



Re: [PHP-DB] MySQL Insert

2004-01-07 Thread ma
hi!

no problem... people should help each other ;)

so: no there is no difference. if you want people to have the possibility to
download the file there are certain things to remember of. just a short
example:

?php

$con = mysql_connect(...);
mysql_select_db();

$file = $_GET['file'];

$qry = 'SELECT `data` FROM `files` WHERE `file`='.addslashes($file).''; //
prevent from sql-injection-attacks
$res = mysql_query($qry);
// errorhandling missing
$data = mysql_fetch_assoc($res);
$data = $data['data'];

$fileInfo = pathinfo($file);

switch($fileInfo['extension']) {
   case pdf: $ctype=application/pdf;  break;
   case exe: $ctype=application/octet-stream;  break;
   case zip: $ctype=application/zip;  break;
   case doc: $ctype=application/msword;break;
   case xls: $ctype=application/vnd.ms-excel;  break;
   case ppt: $ctype=application/vnd.ms-powerpoint; break;
   case gif: $ctype=image/gif;break;
   case png: $ctype=image/png;break;
   case jpg: $ctype=image/jpg;break;
   default:$ctype=application/force-download; break;
}

header('Content-Type: '.$ctype);
header('Content-Disposition: attachment; filename='.$file
header('Content-Transfer-Encoding: binary');
header('Content-Length: '.strlen($data)); // not sure if it works

echo $data;
?

greets -ma

# life would be easier if i knew the source code...

 Von: Will W [EMAIL PROTECTED]
 Antworten an: [EMAIL PROTECTED]
 Datum: Wed, 7 Jan 2004 21:03:40 -0500
 An: [EMAIL PROTECTED]
 Betreff: Re: [PHP-DB] MySQL Insert
 
 Thanks!!! :)
 
 For getting the info from the database is it like all the rest or is there a
 certain way to get those types of files from the database?
 
 Thanks,
 ~~Will~~
 
 - Original Message -
 From: ma [EMAIL PROTECTED]
 To: PHP-DB [EMAIL PROTECTED]
 Sent: Wednesday, January 07, 2004 8:42 PM
 Subject: Re2: [PHP-DB] MySQL Insert
 
 
 hi!
 
 just to add:
 
 use file() only if you run php 4.3.0 or higher.
 
 if this is not the case use this syntax (its binary safe):
 
 $fp = fopen($_FILES['myFile']['tmp_name'], 'r'); # on windows use 'rb'
 instead of 'r'
 $data = fread($fp, file_size($_FILES['myFile']['tmp_name']));
 fclose($fp);
 
 instead of $data = join(etc);
 
 greets - ma
 
 # life would be easier if i knew the source code...
 
 --
 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] MySQL Insert

2004-01-07 Thread John W. Holmes
Will W wrote:

Can anyone tell me how to insert a file, 
say a .doc, .txt or a .rtf file into a table from an upload form??
How about just this:

$query = INSERT INTO Table (orig_name, size, mime_type, data) VALUES 
('{$_FILES['userfile']['name']}', '{$_FILES['userfile']['size']}', 
'{$_FILES['userfile']['type']}',LOAD_FILE('{$_FILES['userfile']['tmp_name']}'));

Adapt to your needs. No need for PHP to read the file when you can just 
let MySQL do it. :)

--
---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] MySQL Insert via SQL?

2004-01-07 Thread ma
hi!

just a question: don't know it exactly: isn't it possible that the sql-user
on the server may not have enough rights to read the file?

anyway, i would save the file elsewhere on the server, because there are
remarkable performance-issues with big data (tried it once with storing
images for a photo-gallery). it is much faster saving the file in some
directory and just save the path to the file in the db; which on the other
hand, can lead to synchronisation-problems. what do you think about this
topic?

thx -ma

# life would be easier if i knew the source code...

 Von: John W. Holmes [EMAIL PROTECTED]
 Antworten an: [EMAIL PROTECTED]
 Datum: Wed, 07 Jan 2004 21:29:20 -0500
 An: Will W [EMAIL PROTECTED]
 Cc: PHP DB [EMAIL PROTECTED]
 Betreff: Re: [PHP-DB] MySQL Insert
 
 Will W wrote:
 
 Can anyone tell me how to insert a file,
 say a .doc, .txt or a .rtf file into a table from an upload form??
 
 How about just this:
 
 $query = INSERT INTO Table (orig_name, size, mime_type, data) VALUES
 ('{$_FILES['userfile']['name']}', '{$_FILES['userfile']['size']}',
 '{$_FILES['userfile']['type']}',LOAD_FILE('{$_FILES['userfile']['tmp_name']}')
 );
 
 Adapt to your needs. No need for PHP to read the file when you can just
 let MySQL do it. :)
 
 -- 
 ---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
 

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



Re: [PHP-DB] MySQL Insert via SQL?

2004-01-07 Thread John W. Holmes
ma wrote:

just a question: don't know it exactly: isn't it possible that the sql-user
on the server may not have enough rights to read the file?
Yeah, could be. The uploaded file is already somewhere that PHP can 
write to, though, so it's more than likely available for reading by any 
other user.

anyway, i would save the file elsewhere on the server, because there are
remarkable performance-issues with big data (tried it once with storing
images for a photo-gallery). it is much faster saving the file in some
directory and just save the path to the file in the db; which on the other
hand, can lead to synchronisation-problems. what do you think about this
topic?
I agree entirely. I wouldn't put the file in the database either. I gave 
up on arguing that though since people seem so determined to do it. :)

--
---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] MySQL Insert via SQL?

2004-01-07 Thread ma
hi!

thx for your feedback! just wondered about the sql-documentation saying that
the file must be readable t all users. (at least session-files are only
read/write-able to the php-user. so i was uncertain.. imho your solution is
much nicer for saving the file in the db (allthough it may be a bad idea).

you're right ;) sometimes arguing can get anoying (e.g. which distribution
of linux is best and so on...)

greets ma


# life would be easier if i knew the source code...

 Von: John W. Holmes [EMAIL PROTECTED]
 Antworten an: [EMAIL PROTECTED]
 Datum: Wed, 07 Jan 2004 21:52:23 -0500
 An: [EMAIL PROTECTED]
 Cc: PHP-DB [EMAIL PROTECTED]
 Betreff: Re: [PHP-DB] MySQL Insert via SQL?
 
 ma wrote:
 
 just a question: don't know it exactly: isn't it possible that the sql-user
 on the server may not have enough rights to read the file?
 
 Yeah, could be. The uploaded file is already somewhere that PHP can
 write to, though, so it's more than likely available for reading by any
 other user.
 
 anyway, i would save the file elsewhere on the server, because there are
 remarkable performance-issues with big data (tried it once with storing
 images for a photo-gallery). it is much faster saving the file in some
 directory and just save the path to the file in the db; which on the other
 hand, can lead to synchronisation-problems. what do you think about this
 topic?
 
 I agree entirely. I wouldn't put the file in the database either. I gave
 up on arguing that though since people seem so determined to do it. :)
 
 -- 
 ---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
 

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



Re: [PHP-DB] oracle compilation with php

2004-01-07 Thread Christopher Jones
Douglas,

To try and reduce confusion, a Client install refers to the option
of that name in the Oracle9i Database Release installer. (The other
options are Database, Mgt  Intg, and Cluster Mgt).
This will install the headers needed to link PHP, if your previous
installer choice didn't load them.
The Oracle/PHP/Linux install notes at
http://otn.oracle.com/tech/opensource/php/apache/inst_php_apache_linux.html
skim over this but otherwise might have some info that is helpful and
applicable to Tru64.
Chris

Michael Mauch wrote:
Douglas B. Jones wrote:
 

I did not see an answer on php-install.


http://lists.php.net/article.php?group=php.installarticle=12457

I have also tried oci8,
but I get the error mentioned at the bottom of my post. I have
the ORA_HOME set, both on the shell level and the makefile level.


It's ORACLE_HOME, not ORA_HOME. You have to set and export it in the
shell.

I look under the ORA_HOME root with 'find ORA_HOME -name oci.h
-print', and I get nothing. When I look for all headers, '*.h',
I get none of the ones missing for php oci8 or oracle options.
Thanks for the quote below, I will then want to look more to
the oci8 calls then. Unfortunately, neither oci8 or oracle php
option let me compile, due to the respective missing header files.


Yes, Oracle's installer is fun.

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