Re: [PHP] $HTTP_POST_VARS problem

2002-12-16 Thread rblack

Think you want $HTTP_POST_FILES rather than $HTTP_POST_VARS.

As in $HTTP_POST_FILES['userfile']['name'];

HTH,

Richy

==
Richard Black
Senior Developer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 951 3481
Email: [EMAIL PROTECTED]


   

"Lee P.

Reilly"  To: PHP <[EMAIL PROTECTED]>   

 Subject: [PHP] $HTTP_POST_VARS problem

   

16/12/2002 

15:48  

   

   





Hi there,

I'm currently using PHP 4.2.2 and I am have encountered some problems
when trying to access $HTTP_POST_VARS. The following statements have the
following return values:

echo $HTTP_POST_VARS['userfile'];
=> C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir

echo $userfile;
=> C:\\Documents and Settings\\Administrator\\Desktop\\IR Files\\gmp1.ir

echo $HTTP_POST_VARS['userfile']['name'];
=> NOTHING RETURNED

echo $HTTP_POST_VARS['userfile']['size'];
=> NOTHING RETURNED

echo $userfile_size;
=> NOTHING RETURNED

echo $userfile_name;
=> NOTHING RETURNED

Does anyone know what the problem is? I suspect that the '\\' in the
path may have something to do with it.

Thanks,
Lee


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



This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com






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




[PHP] Parameters and Access

2002-12-31 Thread rblack

Hi All,

I'm trying to run a parameterised query in MS Access using odbc_prepare and
odbc_execute but to no avail.

The error message I'm getting is:

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Too few
parameters. Expected 1., SQL state 07001 in SQLExecute in c:
\inetpub\wwwroot\test\access_db.php on line 17

I've read conflicting messages saying that this paramaterised queries with
Access do or don't work. Any definitive answer?

Win XP
Apache 1.3.24
PHP 4.2.3
Access ODBC driver: 4.00.6019.00

Thanks

Richy

==
Richard Black
Senior Developer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 951 3481
Email: [EMAIL PROTECTED]


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




Re: [PHP] money

2003-01-09 Thread rblack

number_format()

http://www.php.net/manual/en/function.number-format.php

==
Richard Black
Senior Developer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 951 3481
Email: [EMAIL PROTECTED]


   

"Wilbert   

Enserink"To: <[EMAIL PROTECTED]>   

<[EMAIL PROTECTED]   cc:   

l>   Subject: [PHP] money  

   

09/01/2003 

10:44  

   

   





Hi all,



I'm busy making a swebstore. I have troubles with the format of money.

I wanrt to display amounts like "2 products a ? 6,25 = ? 12,50"


Whatever I try I can't get the comma there (it's showing a point "." and it
doesn't display the second number behind the comma i.e. "12.5"

Anybody knows how to make me my money? :-)

regards Wilbert




-
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-


This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com





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




Re: [PHP] Converting Excel Spreadsheet to MySQL table ...

2003-01-10 Thread rblack

If this is a one off excercise, ie you only have to do it once and
afterwards things will be dealt with ENTIRELY through the MySQL database,
you could save the spreadsheet as a CSV file and work with that.

HTH,

Richy

==
Richard Black
Senior Developer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 951 3481
Email: [EMAIL PROTECTED]


   

Maxim Maletsky 

<[EMAIL PROTECTED]   To: "Adam Ferguson" 
<[EMAIL PROTECTED]>   
>cc: <[EMAIL PROTECTED]>   

 Subject: Re: [PHP] Converting Excel 
Spreadsheet to MySQL table ...
10/01/2003 

11:40  

Please respond 

to maxim   

   

   






Excel on its own is a compiled document. However, I think there was some
way to do that. I remember I had to do it for MS Aceess files (Access ->
mySQL) and i used a tool made by a brasilian guy, (someone remind me the
name). I have the feeling that this is accomplisheable. Not sure if
directly on Linux box...


--
Maxim Maletsky
[EMAIL PROTECTED]



"Adam Ferguson" <[EMAIL PROTECTED]> wrote... :

> Hello ...
>
> I was wondering if anyone had a good resource or code sample for opening
( or accessing ) an excel spreadsheet using php.  I need to be able to
convert a spreadsheet of products and info to a table of products in a
mysql database.  Also ... I need to be able to perform this on a Linux
machine.  Any help would be great.
>
> Thanks guys!
> Adam Ferguson


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



This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com






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




Re: [PHP] Recursion with database tables

2003-02-19 Thread rblack

I'm assuming the comments don't include the topid id - if they did this
would be trivial.

So I'm assuming the following structure...

Topics:
  topicid

Messages:
  messageid
  topicid

Comments:
  commentid
  messageid

So, say you want to delete topic 23, and all messages/comments associated
with it.

First, select all the message ids which apply to that topic.
eg
  SELECT messageid FROM messages WHERE topicid = '23';

Loop through the messageid fields that are returned by this, and for each
one delete any associated comments
eg if one of the messages on topic 23 had the messageid 12

  DELETE FROM comments WHERE messageid = '12';

So that's the comments gone. Now delete the messages, and finally the topic
itself

  DELETE FROM messages WHERE topicid = '23';
  DELETE FROM topics WHERE topicid = '23';

And that's you.

There's plenty of variations on this of course - rather than deleting the
comments for each message separately, you could do that in one query by
building up a list of all the messageids you need to get rid of, something
like :

  DELETE FROM comments WHERE messageid IN ('12', '22', '34', '46');

or something like that - I can't remember the exact syntax offhand, but it
would be something like that.

HTH,

Richy
==
Richard Black
Senior Developer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 951 3481
Email: [EMAIL PROTECTED]


   
 
  Jono Bacon   
 
 
  ahoo.co.uk>   cc:
 
Subject:  Re: [PHP] Recursion with 
database tables  
  19/02/2003 14:16 
 
  Please respond to
 
  jonobacon_lists  
 
   
 
   
 




David Otton wrote:

>On Wed, 19 Feb 2003 13:56:49 +, you wrote:
>
>
>
>>One questions though - if I delete a topic, I need to delete all of its
>>child messages and all of the child comments from each message. What is
>>the best technique to do this? This has been driving me up the wall as
>>it seems to involve some kind of looping and recursion.
>>
>>
>
>make sure /all/ your comments have the correct topicid set. Then simply
>"DELETE FROM comment WHERE topicid = x"
>
>Otherwise, yes, in MySQL you have to recurse down the tree deleting
>comments.
>
>
How would I go about recursing down the tree? Has anyone done this before?

Jono


>
>


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



This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com







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