Re: [PHP-DB] Store a File (any type) in MySQL

2004-03-21 Thread Bruno Santos
Daniel Crespo wrote:

Hi everybody...

Anyone knows how to store a file (any type) in MySQL?

Thanks

 

hello

MySql has binary field types, but, are they long (in size) enough for 
your file ?
if the file is small, i guess you could store the data in the mysql 
field, but, and if files are user choosen ???

why dont u consider storing the data, or the file, in some directory and 
just put the location (file name) in some field in the database ?? is 
more safe and overflow free

cheers

--
-
   .-'''''-.
.' `.
   : :
  :   :
  :  _/|  :   Bruno Santos
   :   =/_/  : [EMAIL PROTECTED]
`._/ | .'
 (   /  ,|...-'Pagina Pessoal
  \_/^\/||__   http://feiticeir0.no-ip.org
   _/~  `""~`"` \_
__/  -'/  `-._ `\_\__
  /jgs  /-'`  `\   \  \-.\
  "Written very small on the back poket of a girl's jeans
  - 'If you can read this, you're WAY too close.'"
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] File Upload

2004-03-16 Thread Bruno Santos
Hello all

Can someone tell me why PHP give all this erros, when it really opens 
the file and displays all it's contents ?



Uploading files...
File Type: text/plain
UP: /tmp/teste.txt
UP2: teste.txtFile uploaded successfully
*Warning*: fopen(teste.txt): failed to open stream: Permission denied in 
*/usr/local/apache2/htdocs/projecto/examples/upload.php* on line *87*

*Warning*: fwrite(): supplied argument is not a valid stream resource in 
*/usr/local/apache2/htdocs/projecto/examples/upload.php* on line *88*

*Warning*: fclose(): supplied argument is not a valid stream resource in 
*/usr/local/apache2/htdocs/projecto/examples/upload.php* on line *89*
Preview of uploaded file contents:

This is a test <- File content



cheers all
Thx in advance
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] No data being put into the DB

2004-03-04 Thread Bruno Santos
Hello. I'm not sure, but, witch version of php are u using ?

replace all the instances of $_POST[varname] with

$HTTP_POST_VARS[' varname '] and see what happens !!!

Cheers

Robert Sossomon wrote:

I have a form:
http://www.garlandcnorris.com/registration_tradeShow.html
That then goes to this page:

$display_block = "";
$date_sub = date("mdY - H:i:s");
$addtocart = "insert into show
values('','$_POST[Accnt_name]','$_POST[acc_num]','$_POST[email]','$_POST
[auth_buyer]','$_POST[attend_1]','$_POST[attend_2]','$_POST[attend_3]','
$_POST[num_att]', '$date_sub')";
$result = mysql_query($addtocart);
mysql_close();
$error = mysql_error();
print "the query I just ran was: $addtocart";
print "the result I just ran was: $result";
print "the error I just ran was: $error";
$display_block = "";
$display_block .= "Thank you for registering for the Garland
C Norris 100 year Celebration Trade Show and
party!\n\nThe information you submitted on
$date_sub was:Account Name: $_POST[Accnt_name]Account Number:
$_POST[acc_num]Email Address: $_POST[email]Authorized Buyer:
$_POST[auth_buyer]Attendee: $_POST[attend_1]Attendee:
$_POST[attend_2]Attendee: $_POST[attend_3]# Attending Party:
$_POST[num_att]";
$sendto = "$_POST[email]";
$subject = "Registration Details";
$message = "Thank you for registering for the Garland C Norris 100 year
Celebration Trade Show and party! \n\n The information you submitted on
$date_sub was: \n Account Name: $_POST[Accnt_name] \n Account Number:
$_POST[acc_num] \n Email Address: $_POST[email] \n Authorized Buyer:
$_POST[auth_buyer]\nAttendee: $_POST[attend_1]\nAttendee:
$_POST[attend_2]\nAttendee: $_POST[attend_3]\n# Attending Party:
$_POST[num_att]";
$header = 'From: [EMAIL PROTECTED]';
mail($sendto, $subject, $message,$header);

$display_block .= "\nhttp://www.gcnorris.com/index3.html\";>Click Here to continue
through to the Garland C Norris Website. You should be receiving
an email shortly with the information you have just submitted.We
look forward to seeing you in May!";
?>


Thanks For Registering


rightmargin="0" marginwidth="0" marginheight="0" height="100%" width="100%"> This is the results: the query I just ran was: insert into show values('','robert\'s Test','123456','[EMAIL PROTECTED]','Robert','','','','69', '03032004 - 17:30:20') the result I just ran was: the error I just ran was: Thank you for registering for the Garland C Norris 100 year Celebration Trade Show and party! The information you submitted on 03032004 - 17:30:20 was: Account Name: robert\'s Test Account Number: 123456 Email Address: [EMAIL PROTECTED] Authorized Buyer: Robert Attendee: Attendee: Attendee: # Attending Party: 69 DB Table: Empty Field descriptions: CREATE TABLE `show` ( `id` int(11) NOT NULL default '0', `act_name` text, `acc_num` int(6) default '0', `email` text, `auth_buyer` text, `attend_1` text, `attend_2` text, `attend_3` text, `num_att` int(2) default NULL, `date_sub` text, PRIMARY KEY (`id`) ) TYPE=MyISAM; There are no errors in the php-error log, the mysql error log, the httpd error log, however there is NOTHING in my 'show' table right now and I should have about 80 things in there. Any thoughts?? I am at my wits end trying to figure out the goofy thing. I have counted the fields (10 for each) so I made doubly sure I have 10 fields in the DB table -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php