[PHP-DB] need INSERT help

2003-01-27 Thread Addison Ellis
hello,
	can someone help me with this? i have tried all i know and i 
am very new at this... my apologies.
	i am trying to have multiple forms, all with different 
fields/values, point to one .php that will foreach($HTTP_POST_VARS as 
$key = $VALUE)
1) check for if ($value == )
2) ereg function
3) $$key = strip_tags(trim($value));
4) $today = date(-m-d);
5) $sql = INSERT INTO tablename ($HTTP_POST_VARS)
VALUES ('$$HTTP_POST_VARS values');
mysql_query($sql);

the problem i am having is i have so many different form 
fields/values. i am almost resigning to having one .php for each form 
but i know there is a better way. and... anyway... thanks for looking 
at this. best regards, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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



[PHP-DB] REVISED; need INSERT help

2003-01-27 Thread Addison Ellis
hello again and i am sorry i was not more specififc in my last post.
	here is where i am confused:
 else   
  {
$today = date(Y-m-d h:m:s);
$sql = INSERT INTO ads () VALUES
('$first_name','$last_name','$email','$phone','$univ_status',
 '$password','$today');
mysql_query($sql);
$auth=yes; 
$logname = $email;


for the actual insert, what do i put in order to avoid having to do a 
separate .php for each form and list the fields/values from each 
form? thanks and sorry again. addison


previous post:


hello,
	can someone help me with this? i have tried all i know and i 
am very new at this... my apologies.
	i am trying to have multiple forms, all with different 
fields/values, point to one .php that will foreach($HTTP_POST_VARS as 
$key = $VALUE)
1) check for if ($value == )
2) ereg function
3) $$key = strip_tags(trim($value));
4) $today = date(-m-d);
5) $sql = INSERT INTO tablename ($HTTP_POST_VARS)
VALUES ('$$HTTP_POST_VARS values');
mysql_query($sql);

the problem i am having is i have so many different form 
fields/values. i am almost resigning to having one .php for each form 
but i know there is a better way. and... anyway... thanks for looking 
at this. best regards, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

RE: [PHP-DB] simple mail attachment with php?

2003-01-27 Thread Bruno Pereira
Try that, is very good, i have the same problem and someone send me that,
try it. I hope is the right one.
Thats just a class, but inside there is the instruction. I put it to work
and is very good.

Cumprimentos

Bruno Pereira
[EMAIL PROTECTED]

-Original Message-
From: cornelia es said [mailto:[EMAIL PROTECTED]]
Sent: sexta-feira, 24 de Janeiro de 2003 18:56
To: [EMAIL PROTECTED]
Subject: [PHP-DB] simple mail attachment with php?


hi you out there...
i hope you're all fine :)

has anybody an idea how to attach a simple text-file to the php
mail()-function???
the scripts i found on the net are quite complicated, featuring different
mime-types, more than one attachment,...

i really would need just the absolute basic functionality to send just ONE
attachment as .txt-file.
(i think this would also be the best way for me to understand the concept ;)

THANKS A LOT in advance
and have a very nice weekend :)
cornelia



cornelia es said

spacedealeragentur für online media GmbH

internet marketing consulting



[Strasse] paul lincke ufer 42_43  [Ort]  Berlin  10999

[Fon] + 49_030 69 53 50 16[Fax] +49_030 69 53 50 77

[www.] spacedealer.de












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


[PHP-DB] BLOB

2003-01-27 Thread heilo
Hi everybody out there!

Does anybody know a good reference, where I can lern how to insert binary
data (e.g. Images) into a BLOB-Field of a MySQL-Database?

Any help would be warmely appreciated

- Matthias St.



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




[PHP-DB] BLOB

2003-01-27 Thread heilo
Hi everybody out there!

Does anybody know a good reference, where I can lern how to insert binary
data (e.g. Images) into a BLOB-Field of a MySQL-Database?

Any help would be warmely appreciated

- Matthias St.



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




RE: [PHP-DB] BLOB

2003-01-27 Thread John W. Holmes
 Does anybody know a good reference, where I can lern how to insert
binary
 data (e.g. Images) into a BLOB-Field of a MySQL-Database?

Use fopen() to open the image, fread() it into a variable, and insert
that variable like you would any other one. If the image is coming from
an input type=file element, then you already have the image data
present in the $_FILES array that you can insert. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




Re: [PHP-DB] BLOB

2003-01-27 Thread heilo
Thxalot!

I didn't thought it would be that easy *g*


- matthias st.


John W. Holmes [EMAIL PROTECTED] [EMAIL PROTECTED] 14:12 Uhr:

 Does anybody know a good reference, where I can lern how to insert
 binary
 data (e.g. Images) into a BLOB-Field of a MySQL-Database?
 
 Use fopen() to open the image, fread() it into a variable, and insert
 that variable like you would any other one. If the image is coming from
 an input type=file element, then you already have the image data
 present in the $_FILES array that you can insert.
 
 ---John W. Holmes...
 
 PHP Architect - A monthly magazine for PHP Professionals. Get your copy
 today. http://www.phparch.com/
 
 



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




[PHP-DB] problem configuring PHP 4.3 to get sybase ct_connect to connect

2003-01-27 Thread Art Chevalier
Hello,

I recently upgraded from PHP 4.2.3 to 4.3 and Apache 1.3 to 2.+. Previously
I wasnt having a problem connecting to Sybase. After the upgrade I cant
connect using the ct_connect library. My php.ini file hasnt changed. Any
ideas?

Here is my error: Warning: sybase_connect() [function.sybase-connect]:
Sybase: Unable to allocate connection record in
D:\website\code243\monitor\scripts\classes\connect_class.php on line 54

Thank You,

Art



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




[PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-27 Thread Geckodeep
Hi,

Can any one guide me through the uploading file procedure please?
Should I use copy() function to copy the image file to a temp file and
rename it to the real name and then reference the name in the data base.
Or is there any other way.
Should say though my Service Provider does not support exec(cp $picture
/full/path/to/joesauto/images/$picture_name) as explained in one of the
article in phpbuilder by Willim Samplonius.
Also I've found other old articles related to this but none of them have
helped me so far to solve my problem.

I've identified the steps to build the page.
1)  Upload and store in to the directory
2)  Get the Url of the image
3)  Store the URL into Mysql table

And later retrieve the image which is my second part.
Having I identified the steps can any one help me how to translate that into
Php please.

I forgot to mention that what I am uploading, which in this case are 9 Jpeg
images.
Which should be uploaded together with one submit button.
The table is as follows:
Image_tbl
ID|Caption|ImgFileName|
This Image_tbl is related to an Article table
Art_tbl
ID|Title|Article|

So as you can see that 9 images are related to an article and one thing is
sure there are always 9 images for each article.


Thanks

GD



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




RE: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-27 Thread John W. Holmes
 Can any one guide me through the uploading file procedure please?
 Should I use copy() function to copy the image file to a temp file and
 rename it to the real name and then reference the name in the data
base.
 Or is there any other way.
 Should say though my Service Provider does not support exec(cp
$picture
 /full/path/to/joesauto/images/$picture_name) as explained in one of
the
 article in phpbuilder by Willim Samplonius.

You should be able to use move_uploaded_file() instead of the exec()
call. 

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



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




RE: [PHP-DB] simple mail attachment with php?

2003-01-27 Thread Matthew Moldvan
Did you forget to attach the class?

Regards,
Matthew Moldvan

---
 System Administrator
 Trilogy International, Inc
 Work: (313) 593-7993 x 116
 Cell: (734) 658-0997
 http://www.trilogyintl.com/ecommerce/
---

-Original Message-
From: Bruno Pereira [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 6:04 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] simple mail attachment with php?


Try that, is very good, i have the same problem and someone send me that,
try it. I hope is the right one.
Thats just a class, but inside there is the instruction. I put it to work
and is very good.

Cumprimentos

Bruno Pereira
[EMAIL PROTECTED]

-Original Message-
From: cornelia es said [mailto:[EMAIL PROTECTED]]
Sent: sexta-feira, 24 de Janeiro de 2003 18:56
To: [EMAIL PROTECTED]
Subject: [PHP-DB] simple mail attachment with php?


hi you out there...
i hope you're all fine :)

has anybody an idea how to attach a simple text-file to the php
mail()-function???
the scripts i found on the net are quite complicated, featuring different
mime-types, more than one attachment,...

i really would need just the absolute basic functionality to send just ONE
attachment as .txt-file.
(i think this would also be the best way for me to understand the concept ;)

THANKS A LOT in advance
and have a very nice weekend :)
cornelia



cornelia es said

spacedealeragentur für online media GmbH

internet marketing consulting



[Strasse] paul lincke ufer 42_43  [Ort]  Berlin  10999

[Fon] + 49_030 69 53 50 16[Fax] +49_030 69 53 50 77

[www.] spacedealer.de












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




RE: [PHP-DB] simple mail attachment with php?

2003-01-27 Thread Bruno Pereira
No, you didn't get it?
But cornelia es said, just told me that i have mistaken and put an ftp clss,
my mistake.

Cumprimentos

Bruno Pereira
[EMAIL PROTECTED]

-Original Message-
From: Matthew Moldvan [mailto:[EMAIL PROTECTED]]
Sent: segunda-feira, 27 de Janeiro de 2003 17:21
To: 'Bruno Pereira'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] simple mail attachment with php?


Did you forget to attach the class?

Regards,
Matthew Moldvan

---
 System Administrator
 Trilogy International, Inc
 Work: (313) 593-7993 x 116
 Cell: (734) 658-0997
 http://www.trilogyintl.com/ecommerce/
---

-Original Message-
From: Bruno Pereira [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 6:04 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] simple mail attachment with php?


Try that, is very good, i have the same problem and someone send me that,
try it. I hope is the right one.
Thats just a class, but inside there is the instruction. I put it to work
and is very good.

Cumprimentos

Bruno Pereira
[EMAIL PROTECTED]

-Original Message-
From: cornelia es said [mailto:[EMAIL PROTECTED]]
Sent: sexta-feira, 24 de Janeiro de 2003 18:56
To: [EMAIL PROTECTED]
Subject: [PHP-DB] simple mail attachment with php?


hi you out there...
i hope you're all fine :)

has anybody an idea how to attach a simple text-file to the php
mail()-function???
the scripts i found on the net are quite complicated, featuring different
mime-types, more than one attachment,...

i really would need just the absolute basic functionality to send just ONE
attachment as .txt-file.
(i think this would also be the best way for me to understand the concept ;)

THANKS A LOT in advance
and have a very nice weekend :)
cornelia



cornelia es said

spacedealeragentur für online media GmbH

internet marketing consulting



[Strasse] paul lincke ufer 42_43  [Ort]  Berlin  10999

[Fon] + 49_030 69 53 50 16[Fax] +49_030 69 53 50 77

[www.] spacedealer.de












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




[PHP-DB] too many connections?

2003-01-27 Thread Addison Ellis
hello and thank you.
	any idea what this means? i have not touched or changed my 
config.php file since i put it up the first time... it contains my db 
connect info. also, i just downloaded it from the server to see if it 
had been modified and it had not. thanks again and best, addison

Warning: Too many connections in 
/users/infoserv/web/register/ca/admin/config.php on line 5

Warning: MySQL Connection Failed: Too many connections in 
/users/infoserv/web/register/ca/admin/config.php on line 5
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Re: [PHP-DB] too many connections?

2003-01-27 Thread John Krewson

This would make a whole lot more sense within a context...such as how 
busy is your application, what kind of connection you are using 
(pconnect vs. connect) and so on.

A quick search on MySQL's web site resulted in:

http://www.mysql.com/doc/en/Too_many_connections.html

Be sure to check out general messages in the mailing list archives as 
well and Google.

Good luck.


Addison Ellis wrote:

hello and thank you.
any idea what this means? i have not touched or changed my
config.php file since i put it up the first time... it contains my db
connect info. also, i just downloaded it from the server to see if it
had been modified and it had not. thanks again and best, addison

Warning: Too many connections in
/users/infoserv/web/register/ca/admin/config.php on line 5

Warning: MySQL Connection Failed: Too many connections in
/users/infoserv/web/register/ca/admin/config.php on line 5



--
John Krewson
Programmer - SWORPS


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




Re: [PHP-DB] too many connections?

2003-01-27 Thread 1LT John W. Holmes
 any idea what this means? i have not touched or changed my
 config.php file since i put it up the first time... it contains my db
 connect info. also, i just downloaded it from the server to see if it
 had been modified and it had not. thanks again and best, addison

 Warning: Too many connections in
 /users/infoserv/web/register/ca/admin/config.php on line 5

 Warning: MySQL Connection Failed: Too many connections in
 /users/infoserv/web/register/ca/admin/config.php on line 5

It's exactly what it say, there are too many connections to your MySQL
server. By default, you can have 100 connections to a MySQL server. If you
have a ton of traffic, you will need to increase that limit so that you
don't get errors like this. If you don't have enough traffic to generate 100
connections at the same time, then run a SHOW PROCESSLIST on your MySQL
server to see if you have a query locking things up and everything else is
waiting (did this the other day, oops!)

---John Holmes...


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




[PHP-DB] resolved : Re: [PHP-DB] too many connections?

2003-01-27 Thread Addison Ellis
i searched at mysql.com and it said basically what you are asking. i 
contacted the server admin and they are going to re-set the server. 
thank you for your time. best regards, addison


Assuming that line 5 is the dbconnect, is there a limit on the number of
connections that your MySQL server allows? Is there a limit set in
php.ini?


Shannon Johnston

On Mon, 2003-01-27 at 15:13, Addison Ellis wrote:

 hello and thank you.
	any idea what this means? i have not touched or changed my
 config.php file since i put it up the first time... it contains my db
 connect info. also, i just downloaded it from the server to see if it
 had been modified and it had not. thanks again and best, addison

 Warning: Too many connections in
 /users/infoserv/web/register/ca/admin/config.php on line 5

 Warning: MySQL Connection Failed: Too many connections in
 /users/infoserv/web/register/ca/admin/config.php on line 5

--
Shannon Johnston [EMAIL PROTECTED]


--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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




[PHP-DB] elseif

2003-01-27 Thread Addison Ellis
hello and thank you for your time.
	will the below work to check if one field or the other is 
filled in upon submission? either contact_phone or contact_email is 
required but not both. best, addison

$error = ;
if ($name == )
	{
	$error = $errorLIYou must enter a company name./LI;
	}
if ($address == )
{
$error = $errorLIYou must enter an address./LI;
}
if ($city == )
{
$error = $errorLIYou must enter a city./LI;
}
if ($state == )
{
$error = $errorLIYou must enter a state./LI;
}
if ($zip == )
{
$error = $errorLIYou must enter a zip./LI;
}
if ($contact_phone == )
{
$error = $errorLIYou must enter a contact phone number or 
email address./LI;
}
elseif ($contact_email == )
{
$error = $errorLIYou must enter a contact phone number or 
email address./LI;
}
if ($error == )
	{
	$query = insert into stores  set
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

RE: [PHP-DB] elseif

2003-01-27 Thread Ryan Jameson (USA)
You should probably replace $name ==  with strlen($name)  1.
Also, you should probably used $error .= instead of $error = so that you can list all 
the errors instead of just the last one.

 Ryan


-Original Message-
From: Addison Ellis [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 27, 2003 5:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] elseif


hello and thank you for your time.
will the below work to check if one field or the other is 
filled in upon submission? either contact_phone or contact_email is 
required but not both. best, addison

$error = ;
if ($name == )
{
$error = $errorLIYou must enter a company name./LI;
}
if ($address == )
 {
 $error = $errorLIYou must enter an address./LI;
 }
if ($city == )
 {
 $error = $errorLIYou must enter a city./LI;
 }
if ($state == )
 {
 $error = $errorLIYou must enter a state./LI;
 }
if ($zip == )
 {
 $error = $errorLIYou must enter a zip./LI;
 }
if ($contact_phone == )
 {
 $error = $errorLIYou must enter a contact phone number or 
email address./LI;
 }
elseif ($contact_email == )
 {
 $error = $errorLIYou must enter a contact phone number or 
email address./LI;
 }
if ($error == )
{
$query = insert into stores  set
-- 
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

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




Re: [PHP-DB] elseif

2003-01-27 Thread Paul Chvostek
On Mon, Jan 27, 2003 at 06:26:06PM -0600, Addison Ellis wrote:
 
 hello and thank you for your time.
   will the below work to check if one field or the other is 
 filled in upon submission? either contact_phone or contact_email is 
 required but not both. best, addison

I would use something like:

$error = ;
if (strlen(trim($name))  1) {
$error .= liYou must enter a company name.\n;
}
...
if (! ($contact_phone || $contact_email) ) {
$error .= liYou must enter a contact phone number or email address.\n;
}
if (strlen(trim($contact_email))  0  
eregi('[a-z0-9_.-]+@([a-z0-9]+\.)+[a-z][a-z]+',$contact_email)) {
$error .= liEmail address has an invalid format.\n;
}
if (!$error) {
$q = INSERT INTO stores blah blah;
...
}

 $error = ;
 if ($name == )
   {
   $error = $errorLIYou must enter a company name./LI;
   }
 if ($address == )
  {
  $error = $errorLIYou must enter an address./LI;
  }
 if ($city == )
  {
  $error = $errorLIYou must enter a city./LI;
  }
 if ($state == )
  {
  $error = $errorLIYou must enter a state./LI;
  }
 if ($zip == )
  {
  $error = $errorLIYou must enter a zip./LI;
  }
 if ($contact_phone == )
  {
  $error = $errorLIYou must enter a contact phone number or 
 email address./LI;
  }
 elseif ($contact_email == )
  {
  $error = $errorLIYou must enter a contact phone number or 
 email address./LI;
  }
 if ($error == )
   {
   $query = insert into stores  set
 -- 
 Addison Ellis
 small independent publishing co.
 114 B 29th Avenue North
 Nashville, TN 37203
 (615) 321-1791
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
 subsidiaries of small independent publishing co.
 [EMAIL PROTECTED]
 [EMAIL PROTECTED]
-- 
  Paul Chvostek [EMAIL PROTECTED]
  Operations / Abuse / Whatever
  it.canada, hosting and development   http://www.it.ca/


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




Re: [PHP-DB] backing up databases

2003-01-27 Thread David T-G
Chris --

...and then Chris Payne said...
% 
% Hi there everyone,

Hi!


% 
% I have way too many databases to backup manually or with PHPMyADMIN, how, using PHP 
with MySQL could I backup multiple databases easily?

1) What level of 'manual' is too much?

2) Are all of the databases on the server yours to back up, or only some
of them?

3) Do you have access to the command line through your php script as
might be expected, or are you somehow limited?

4) Do you have a user/password who can dump your databases?

5) Can you use cron to run jobs repeatedly?

I'd write a script (php CLI, perl, shell, whatever) to do the dump and
then just call it from your web click or, better yet, from a crontab.


% 
% Any examples would be really appreciated :-)

Answers first, grasshopper :-)


% 
% Thank you.
% 
% Regards
% 
% Chris


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg18010/pgp0.pgp
Description: PGP signature


Re: [PHP-DB] Help/Advice/Suggestions need to Upload 9 images on one submit button.

2003-01-27 Thread Rajesh Fowkar
On Mon, Jan 27, 2003 at 05:05:02PM +0100, Geckodeep wrote:

Hi,

Can any one guide me through the uploading file procedure please?
Should I use copy() function to copy the image file to a temp file and
rename it to the real name and then reference the name in the data base.
Or is there any other way.
Should say though my Service Provider does not support exec(cp $picture
/full/path/to/joesauto/images/$picture_name) as explained in one of the
article in phpbuilder by Willim Samplonius.

All file system functions are not supported ?

Otherwise you case use copy() function rather than exec().

copy($_FILES['Imagefile1']['tmp_name'], 
'./full/path/to/joesauto/images/$_FILES['Imagefile1']['tmp_name']');

Here Imagefile1 is the 'name' in the html form.

td width=30%bPicture 1 (jpeg/png/gif)/b/td
td
   input type=hidden name=MAX_FILE_SIZE value=2
   input maxLength=128 name=Imagefile1 type=file ACCEPT=image/png, image/jpeg, 
image/jpg, image/gif
/td

HTH

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###
  
Sub : Lesser known commands (tac)LOST #165

Everybody has heard of cat, to concatanate files  and print to
standard output. But have you heard of tac ? This reads file
reverse. Try 'tac somefile.txt' and have a look ...  or better
still 'tac somesound.au  /dev/audio' ... Enjoy !

[EMAIL PROTECTED]
:

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




[PHP-DB] MySQL Error

2003-01-27 Thread JordanW
I'm getting this error message when I try the following code:

$link = mysql_connect(localhost)
or die(Could not connect);
print (Connected successfully);
mysql_close($link);

The scripts outputs:

Warning: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3

Warning: MySQL Connection Failed: Can't create TCP/IP socket (10106) in
C:\Projects\WebServer\admin.php on line 3
Could not connect

Any ideas?

Thanks



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




[PHP-DB] Sorting Arrays

2003-01-27 Thread Mark @ Webbiz NZ
Hello,
I don't understand arrays that well. If someone can help me sort the
contents it would be appreciated.

I have data being retrieved from a text file and the fields as an array
inserted into another array.

orderby is numeric is 1-99 and requires sorting ASC
content is just formatted html

for instance :

While Loop
$a++
Get Data content  orderby
$marray[$a] = Array(content=$msort , orderby=$orderby[1]);
End

After this data is retrieved I would like to sort the information by the
orderby field.
Then the information is printed from the content field as per the sorted
order

foreach ($marray as $val) {
  echo $val['content'];
}


If someone can help me out, this would be appreciated.

Regards
Mark
NZ





[PHP-DB] if ($key !=

2003-01-27 Thread Addison Ellis
hello and presumably, thank you again...
	i have quite a few fields from different forms that are not 
required and almost as many that are so i have opted to go with
if ($key != middle_name) format.
	in using this can i separate the different fields like so if 
($key != 'middle_name','address','etc.')
or must i do this: if ($key != middle_name and  $key != address 
and $key != etc. )
{
if ($value == )
} etc...

best, addison
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[PHP-DB] $HTTP_POST_VARS

2003-01-27 Thread Addison Ellis
hello,
	will this work?

$sql = INSERT INTO ads ($HTTP_POST_VARS,createdate)
VALUES ('$key','$today');
mysql_query($sql);

i have this at the top:

foreach ($HTTP_POST_VARS as $key = $value)

thanks again, addison ellis
--
Addison Ellis
small independent publishing co.
114 B 29th Avenue North
Nashville, TN 37203
(615) 321-1791
[EMAIL PROTECTED]
[EMAIL PROTECTED]
subsidiaries of small independent publishing co.
[EMAIL PROTECTED]
[EMAIL PROTECTED]


Re: [PHP-DB] $HTTP_POST_VARS

2003-01-27 Thread Micah Stevens
No, if you're trying to store an array in the database, use serialize();

http://www.php.net/manual/en/function.serialize.php

Something like this:

$serialized_data = serialize($HTTP_POST_VARS);
$serialized_data = addslashes($serialized_data);

mysql_query(INSERT INTO ads (post_vars, createdate)
VALUES ('$seralized_data', '$today'));

When you pull the data back out, stripslashes() and then unserialize and
you'll get your array back. Make sure your database field is typed
correctly, blob should work. 

Alternativley, you could step through the array and store a separate
record for each value/key. That kind of seems like what you're trying in
your code, but don't you want $value rather than $key?

-Micah


On Mon, 2003-01-27 at 22:43, Addison Ellis wrote:
 hello,
   will this work?
 
 $sql = INSERT INTO ads ($HTTP_POST_VARS,createdate)
  VALUES ('$key','$today');
 mysql_query($sql);
 
 i have this at the top:
 
 foreach ($HTTP_POST_VARS as $key = $value)
 
 thanks again, addison ellis


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