RE: [PHP-DB] Mysterious 5 second delay on sybase_connect()

2012-05-25 Thread Tom Lloyd
nsswitch seems to be OK, but it wasn't aliased to localhost for ipv6.  I've 
fixed that now (and knocked back the ipv6 precedence in /etc/gai.conf) and it 
seems to be behaving... 

Still doesn't explain to me why it was looking itself up in the first place...  
Weird :/

-- Tom

-Original Message-
From: charlesmor...@gmail.com [mailto:charlesmor...@gmail.com] On Behalf Of 
Charles Morris
Sent: 24 May 2012 17:40
To: Tom Lloyd
Cc: Matijn Woudt; php-db@lists.php.net
Subject: Re: [PHP-DB] Mysterious 5 second delay on sybase_connect()

Is it's own host name in the hosts file and nsswitch.conf set up correctly?

Alternatively disable all the ipv6 adapters if you aren't using them.

On Thu, May 24, 2012 at 12:23 PM, Tom Lloyd  wrote:
> Say the webserver is called foo, on the domain company.local.  No ipv6 is 
> enabled in the network.  A network trace tells me that when the HTTP request 
> comes in, the webserver sends out a DNS request for " foo.company.local". 
>  Nothing replies, and after 5 seconds it times out and carries on doing what 
> it was doing.
>
> Why would it be doing a DNS lookup for the IPv6 address of its own hostname?  
> And more urgently, how can I stop it?
>
> -Original Message-
> From: Tom Lloyd
> Sent: 24 May 2012 16:26
> To: 'Matijn Woudt'
> Cc: php-db@lists.php.net
> Subject: RE: [PHP-DB] Mysterious 5 second delay on sybase_connect()
>
> I'm getting increasingly suspicious that DNS is to blame.  If I was to do 
> something like:
>
> $conn = sybase_connect( "10.0.0.11\SQLMAIN", $user, $pass )
>
> Would that trigger a lookup of some variety?
>
> -Original Message-
> From: Matijn Woudt [mailto:tijn...@gmail.com]
> Sent: 24 May 2012 13:00
> To: Tom Lloyd
> Cc: php-db@lists.php.net
> Subject: Re: [PHP-DB] Mysterious 5 second delay on sybase_connect()
>
> On Thu, May 24, 2012 at 10:51 AM, Tom Lloyd  
> wrote:
>> Hi there.  I'm working on a PHP-driven project on Debian Squeeze that 
>> connects to an instance of Microsoft SQL Server on Windows Server 2008.
>> I'm using the sybase extensions to PHP.
>>
>> Since I rebooted the webserver on the weekend, both the
>> sybase_connect() and sybase_pconnect() commands will sometimes take 
>> exactly 5 seconds to execute.  It seems to be random whether they do 
>> this or not.  I can't think of anything that could have been changed 
>> by the reboot, unless a package was updated but its associated process never 
>> got restarted...
>>
>> Does anyone know what might cause this behaviour?
>>
>> Cheers,
>> Tom Lloyd
>>
>
> It most likely has nothing to do with PHP, but is rather a routing issue. 5 
> seconds is the default connection time out for TCP/IP, so it probably makes 
> sense that the connection is failing at a lower level.
>
> - Matijn

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



RE: [PHP-DB] Mysterious 5 second delay on sybase_connect()

2012-05-24 Thread Tom Lloyd
Say the webserver is called foo, on the domain company.local.  No ipv6 is 
enabled in the network.  A network trace tells me that when the HTTP request 
comes in, the webserver sends out a DNS request for " foo.company.local".  
Nothing replies, and after 5 seconds it times out and carries on doing what it 
was doing.

Why would it be doing a DNS lookup for the IPv6 address of its own hostname?  
And more urgently, how can I stop it? 

-Original Message-----
From: Tom Lloyd 
Sent: 24 May 2012 16:26
To: 'Matijn Woudt'
Cc: php-db@lists.php.net
Subject: RE: [PHP-DB] Mysterious 5 second delay on sybase_connect()

I'm getting increasingly suspicious that DNS is to blame.  If I was to do 
something like:

$conn = sybase_connect( "10.0.0.11\SQLMAIN", $user, $pass )

Would that trigger a lookup of some variety?

-Original Message-
From: Matijn Woudt [mailto:tijn...@gmail.com]
Sent: 24 May 2012 13:00
To: Tom Lloyd
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Mysterious 5 second delay on sybase_connect()

On Thu, May 24, 2012 at 10:51 AM, Tom Lloyd  wrote:
> Hi there.  I'm working on a PHP-driven project on Debian Squeeze that 
> connects to an instance of Microsoft SQL Server on Windows Server 2008.
> I'm using the sybase extensions to PHP.
>
> Since I rebooted the webserver on the weekend, both the
> sybase_connect() and sybase_pconnect() commands will sometimes take 
> exactly 5 seconds to execute.  It seems to be random whether they do 
> this or not.  I can't think of anything that could have been changed 
> by the reboot, unless a package was updated but its associated process never 
> got restarted...
>
> Does anyone know what might cause this behaviour?
>
> Cheers,
> Tom Lloyd
>

It most likely has nothing to do with PHP, but is rather a routing issue. 5 
seconds is the default connection time out for TCP/IP, so it probably makes 
sense that the connection is failing at a lower level.

- Matijn


RE: [PHP-DB] Mysterious 5 second delay on sybase_connect()

2012-05-24 Thread Tom Lloyd
I'm getting increasingly suspicious that DNS is to blame.  If I was to do 
something like:

$conn = sybase_connect( "10.0.0.11\SQLMAIN", $user, $pass )

Would that trigger a lookup of some variety?

-Original Message-
From: Matijn Woudt [mailto:tijn...@gmail.com] 
Sent: 24 May 2012 13:00
To: Tom Lloyd
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] Mysterious 5 second delay on sybase_connect()

On Thu, May 24, 2012 at 10:51 AM, Tom Lloyd  wrote:
> Hi there.  I'm working on a PHP-driven project on Debian Squeeze that 
> connects to an instance of Microsoft SQL Server on Windows Server 2008.
> I'm using the sybase extensions to PHP.
>
> Since I rebooted the webserver on the weekend, both the 
> sybase_connect() and sybase_pconnect() commands will sometimes take 
> exactly 5 seconds to execute.  It seems to be random whether they do 
> this or not.  I can't think of anything that could have been changed 
> by the reboot, unless a package was updated but its associated process never 
> got restarted...
>
> Does anyone know what might cause this behaviour?
>
> Cheers,
> Tom Lloyd
>

It most likely has nothing to do with PHP, but is rather a routing issue. 5 
seconds is the default connection time out for TCP/IP, so it probably makes 
sense that the connection is failing at a lower level.

- Matijn


[PHP-DB] Mysterious 5 second delay on sybase_connect()

2012-05-24 Thread Tom Lloyd
Hi there.  I'm working on a PHP-driven project on Debian Squeeze that
connects to an instance of Microsoft SQL Server on Windows Server 2008.
I'm using the sybase extensions to PHP.

Since I rebooted the webserver on the weekend, both the sybase_connect()
and sybase_pconnect() commands will sometimes take exactly 5 seconds to
execute.  It seems to be random whether they do this or not.  I can't
think of anything that could have been changed by the reboot, unless a
package was updated but its associated process never got restarted...

Does anyone know what might cause this behaviour?

Cheers,
Tom Lloyd

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



Re: [PHP-DB] Probleme with MySQL queries

2008-09-03 Thread Kendo Tom

Hi ,

   For this situation , you should print out the SQL statement to check 
the value of the variable "$var" .


--
From: "David DURIEUX" <[EMAIL PROTECTED]>
Sent: Wednesday, September 03, 2008 5:07 PM
To: 
Subject: [PHP-DB] Probleme with MySQL queries


Hello

There is a problem when I select a line in mysql table and afet I
delete it.


1/ It works :
$sql = 'SELECT * FROM table WHERE id="10" ';
$req = mysql_query($sql) or die('Erreur SQL
!'.$sql.''.mysql_error());
while($data = mysql_fetch_assoc($req)) {
echo $data['id'];
}
$sql2 = 'DELETE FROM table WHERE id="10" ';
$req2 = mysql_query($sql2) or die('Erreur SQL
!'.$sql2.''.mysql_error());

2/ It don't work :

$sql = 'SELECT * FROM table WHERE id="'.$var.'" ';
$req = mysql_query($sql) or die('Erreur SQL
!'.$sql.''.mysql_error());
while($data = mysql_fetch_assoc($req)) {
echo $data['id'];
}
$sql2 = 'DELETE FROM table WHERE id="'.$var.'" ';
$req2 = mysql_query($sql2) or die('Erreur SQL
!'.$sql2.''.mysql_error());


Results of this queries :

In first case (it works) : I see the id get in mysql and it delete it
after

In second case (it don't work) : I don't see id get in mysql. It's like
if it delete it first and after select.

I have not error in php log.


If somebody can help me, because I try since few hours...


Best regards,

David DURIEUX
Tel : +33 (0)4.74.04.81.34
Port : +33 (0)6.34.99.45.18
Mail : [EMAIL PROTECTED]
Site Web : http://www.siprossii.com/

SIPROSSII
847 route de Frans (Créacité)
69400 Villefranche sur Saône


--
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] Compare a given value with multiple values field

2006-09-16 Thread Tom Atkinson
If you have the literal string "3,31,11,10" in a field in your table 
then you can 'search' for numbers in the string like this:


SELECT * FROM table WHERE CONCAT(',', tablefield1, ',') LIKE '%,3,%'

I don't know if it's the best way of doing it but it works for me.

Natalie Leotta wrote:

I'm not sure I understand your question, but my interpretation would be
solved like this

select * from table where variable in (select id from tablefield1)

I hope this helps you!!

Natalie

On 9/16/06, Hassan <[EMAIL PROTECTED]> wrote:


Hi My Best List, I have a field in a table contains "3,31,11,10" (let say
tablefield1) and I have a given value which I need to check if it 
exists in

that list.

  I've tried:
  SELECT * FROM table WHERE 3 IN ( tablefield1 );

  Any ideas?


-
Get your email and more, right on the  new Yahoo.com





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



Re: FW: [PHP-DB] How to install PHP-DEV package for PDO_OCI

2006-09-16 Thread Tom Atkinson

It's in php-devel.

To find out what package something is in you can ask yum

# yum provides phpize

and it will tell you

php-devel.i386   5.1.4-1updates
Matched from:
/usr/bin/phpize
/usr/lib/php/build/phpize.m4


Choy, Wai Yew wrote:

Hi,

Any kind soul out there can advise me? 


I've also try "yum install php5-dev" and "yum install php-dev"...All not valid..

Thanks.



-Original Message-
From: Choy, Wai Yew [mailto:[EMAIL PROTECTED]
Sent: Fri 9/15/2006 10:25 AM
To: php-db@lists.php.net
Subject: [PHP-DB] How to install PHP-DEV package for PDO_OCI
 
Hi guru,


 


Hope some kind souls out there can help me out here...I've successfully
compile Apache2.2; PHP 5.16 on a Fedora 4 (with the Oracle instant
client) machine...My connection to the remote Oracle database is working
fine using OCI_CONNECT.

 


My next step is to try out PDO. When I do a "php -m", I didn't see the
PDO_OCI module. Hence I downloaded the PDO_OCI-1.0.tgz file and do a
pear install.

 


But it comes out an error "ERROR: `phpize' failed". Then I found out
that phpize error is because the PHP-DEV package is not install. The
problem puzzle me is how do I install PHP5-DEV into my current setup??

 


I do a Google and can't find any PHP5-DEV package for Fedora4
PHP5.1.6...

 


Any help will be greatly appreciated here...

 


Below is some of the output from my machine:

 


[EMAIL PROTECTED] dbtest]# pear install PDO_OCI-1.0.tgz

7 source files, building

running: phpize

Configuring for:

PHP Api Version: 20041225

Zend Module Api No:  20050922

Zend Extension Api No:   220051025

ERROR: `phpize' failed

 

 

 


[EMAIL PROTECTED] dbtest]# php -v

PHP 5.1.6 (cli) (built: Sep 14 2006 12:23:31)

Copyright (c) 1997-2006 The PHP Group

Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

 

 


[EMAIL PROTECTED] dbtest]# php -m

[PHP Modules]

ctype

date

dom

hash

iconv

libxml

oci8

pcre

PDO

posix

Reflection

session

SimpleXML

SPL

SQLite

standard

tokenizer

xml

xmlreader

xmlwriter

zlib

 


[Zend Modules]

 

 


Thanks a million in advance...

Choy


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



[PHP-DB] Need simple example for making an odbc connection

2004-10-25 Thread tom mccord
I am very new to php and I need a simple example for connecting and
retrieving from an odbc connection.

The code I am maintaining currently accesses MySql using the built in
functions for it, but I need to access DB2 and Access databases.

Thanks
- Tom

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



RE: [PHP-DB] newlines to BR tag

2004-10-02 Thread Tom Crimmins
Murat BIYIKLI wrote:
>if there are unknown number of newlines 
>repeating like (\r\n\r\n\r\n) in a post 
>var and if I want to change them to a 
>SINGLE newline, what kind of an iteration 
>should be used? The >message may like below 
>in DB and as you see the \r\n newline codes 
>may repeat severaltimes and should be changed
> to only one SINGLE newline and after read 
>from DB it will be easily coverted to BR tag 
>by nl2br($foo) func.

Instead of using nl2br you could just use
$foo=preg_replace("/(\r\n)+/","",$foo).

---
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa

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



[PHP-DB] Best table structure

2004-06-30 Thread Tom Chubb
Please can someone let me know their opinion on the following:

I have written some code for submitting a top 20 music chart online.
I use the following to insert into mysql:

INSERT INTO chart (name, chartpos, artist, title, label) VALUES

('$name', '1', '$artist', '$title', '$label'),
('$name', '2', '$artist2', '$title2', '$label2'),
('$name', '3', '$artist3', '$title3', '$label3'),

 -- repeat til -

('$name', '20', '$artist20', '$title20', '$label20'),


Another page queries the table and sorts by name (multiple people submit
charts) and latest date.

My question is this:
Would I be better keeping this format and inserting multiple rows on each
submit, or to have one row for all 81 variables ($name, 20 x Position, 20 x
Artists, 20 x Titles, 20 x Labels.)
I know that the latter will be easier to query.

Also, without maintenance, the size of the table for the current method will
get extremely large. Will that affect server performance?

I am still a newbie, so plain explanations would be most appreciated.

Thanks very much in advance.


Tom

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



RE: [PHP-DB] Date Select

2004-06-25 Thread Tom Chubb
Jeffrey,
Thanks for this,
I've just realised that it's always the same no of inserts, so perhaps I
should just order by date then my previous sort field and then limit the
result to 20?
(It's all 20 results that I need displayed)
Thanks,
Tom


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 25 June 2004 12:15
To: Tom Chubb
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Date Select





>How can I query a MySQL table to get the latest results from a date field?
>Basically, I am inserting several records at a time at the end of each
week.
>I want to have a page that displays the results for the last week only.
>The date format in the field is -MM-DD


if you want the latest row -
  select * from table order by max(date_column) limit 1;

if you want rows in a range of dates there are lots o ways, and instead of
showing one or two, I'd suggest taking a look at the manual on dates
http://dev.mysql.com/doc/mysql/en/Date_and_time_functions.html, and seeing
what fits your needs best.  Seems like you may want to look at BETWEEN

And if you don't want to use those, you are always free to use
  select * from table where date_column < '-mm-dd' and date_column
< '-mm-dd' order by date_col desc

HTH
Jeff

--
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] Date Select

2004-06-25 Thread Tom Chubb
How can I query a MySQL table to get the latest results from a date field?
Basically, I am inserting several records at a time at the end of each week.
I want to have a page that displays the results for the last week only.
The date format in the field is -MM-DD


[PHP-DB] Posting Data to MySQL

2004-06-24 Thread Tom Chubb
I am trying to design a form that posts the data to a DB, but being new to
PHP/MySQL, it takes me ages to hand write the code and I'm sure there must
be an easier way to do it?
My form has 100 fields using 20 rows and 5 columns and it's taking me ages
to write the code for it.
Can anyone advise how they code large forms like that and if you know of any
software to make it easier?
I've searched Google for hours and checked loads of Database scripts on
sites like Hotscripts, but can't find anything.
Thanks,
Tom


Re: [PHP-DB] New To PHP

2004-04-17 Thread Tom Cloyes
Thanks again for all of your help. Not having any programming background 
makes for a lot of fun with PHP.
T

At 01:59 PM 4/15/04 +0100, Mikael Grön wrote:
What I did to learn PHP was to surf to http://www.hotscripts.com/ and look 
at other peoples code.
Writing it yourself looking at the hotscript codes also helps you 
understand the logic of it.

Mike

On Apr 15, 2004, at 12:53, Tom Cloyes wrote:

I ma trying to learn PHP and am having difficulty with understanding it. 
Is there a good PHP creator that will create PHP which will let me 
specify what all I need to have done so that I can go back and try to 
figure out just how it all fits together?
Thanks,

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


Re: [PHP-DB] Basic Doubts

2004-04-17 Thread Tom Cloyes
There is a program that I've found that will write the code for you from 
what you have set up in your MySQL database. It's called PHPMaker, and it 
is free to download a trial version which is good for 30 days. 
http://www.hkvstore.com/ is the URL. Being a newbie to PHP, this thing 
really helps.
T

At 08:21 PM 4/16/04 -0700, andy amol wrote:

hi,
   I want to know the following things.
1. How can we maintain referential integrity (rather check) using PHP
Any example code will be helpful.
2. I want to display the column of the tables, how to do that.

3. I want to align the text and the text box on the page.

4. I also want to check the validation of text(numerical or text)

Any example script would be helpful.

thanks in advance.





-
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
Tom
KI8IZ
http://www.wooster-isp.net
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] mysql multi-row insert limitations?

2004-04-16 Thread Tom Reed
I have a lost of 25,000 unique words and I'd like to insert them into my
database.  Does anyone know if there is a limit to the number of rows you
can insert in one statement?

example insert: INSERT INTO table (word) VALUES ('tree'),('book'),
'apple')  --> Enter's three rows in the database?

-tom

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



Re: [PHP-DB] New To PHP

2004-04-15 Thread Tom Cloyes
Lisi,

Thank you for your reply, and I've bookmarked both sites as well as 
downloaded a few scripts that look promising. I've also found another 
creator that may just be what I'm looking for - dbquiksite 
-  http://www.dbqwiksite.com/.
Thanks again,
T

At 03:20 PM 4/15/04 +0200, [EMAIL PROTECTED] wrote:
Not sure about a creator but there are plenty of existing scripts
on the Net you can download and browse to see how they fit together.
You can install and run them, play around with the code, and
see the effects of your changes.
Try hotscripts.com/PHP/ or php.resourceindex.com to start with.

-Lisi

= = = Original message = = =

I ma trying to learn PHP and am having difficulty with understanding
it. Is
there a good PHP creator that will create PHP which will let
me specify
what all I need to have done so that I can go back and try to
figure out
just how it all fits together?
Thanks,
Tom
KI8IZ
http://www.wooster-isp.net
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
Tom
KI8IZ
http://www.wooster-isp.net
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] New To PHP

2004-04-15 Thread Tom Cloyes
Mark,

Thanks for responding.

I have read the books:
PHP4 A Beginners Guide by McCarty from Osborne
Mastering PHP 4.1 by Allen and Hornberger from Sybex
and have poked around in PHP Cookbook by Sklar and Trachtenberg from O'Reilly
Also have read books on MySQL, and am left scratching my head.
Have found a couple of programs that look promising, and the first one I've 
tried - phpmaker - http://www.hkvstore.com/ - is a cookie-cutter type that 
really makes a lot of code. Will have to work with it to see if I can get 
it to do what I need it to do. Was wondering if any of you had experience 
with one of these or do you hand code everything. My client wants to go 
live in a month and the only thing left is the one database and the 
interaction with it, that and the integration with Xoops.

I will look into the book you recommended and continue to poke around. Any 
pointers will be gladly accepted.
Thanks,
T

At 08:11 AM 4/15/04 -0400, Galbreath, Mark A wrote:
I found Lerdorf and Tatroe's "Programming PHP" (O'Reilly 2002) extremely
helpful in understanding the "why" of PHP.
Mark

-Original Message-
From: Tom Cloyes [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 15, 2004 7:54 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] New To PHP
I ma trying to learn PHP and am having difficulty with understanding it. Is
there a good PHP creator that will create PHP which will let me specify
what all I need to have done so that I can go back and try to figure out
just how it all fits together?
Thanks,
Tom
KI8IZ
http://www.wooster-isp.net
--
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
Tom
KI8IZ
http://www.wooster-isp.net
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] New To PHP

2004-04-15 Thread Tom Cloyes
I ma trying to learn PHP and am having difficulty with understanding it. Is 
there a good PHP creator that will create PHP which will let me specify 
what all I need to have done so that I can go back and try to figure out 
just how it all fits together?
Thanks,

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


[PHP-DB] Re: Recursive photo gallery removal problem.

2004-03-26 Thread Tom Reed
No solutions or feedback?
:(

-Tom Reed
[EMAIL PROTECTED]


"Tom Reed" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I designed a photo gallery system, in which I allow users to create
> recursive photo "folders."  The trouble I am having is being able to
delete
> a photo folder, and all folders/photos within it.
>
> Example structure:
>
> Main Folder
>   - Folder 1
>  - Folder a
>  - Folder b
>  - Folder i
>  - Folder ii
>- Folder aa
>-Folder bb
>   - Folder 2
>   - Folder 2a
>...
>
> I am having trouble creating code to delete all folders within the folder
> they choose to delete.
>
> Say I want to delete "Folder b."  In addition to deleting "Folder b," the
> code also needs to delete folders "Folder i," "Folder ii," "Folder aa,"
and
> "Folder bb."
>
> Here's how I've setup the photo gallery table:
>
> CREATE TABLE `gallery` (
>   `uniqueid` int(11) unsigned default NULL,
>   `gallery` int(11) default NULL,
>   `image` varchar(255) default NULL,
>   `height` int(11) default NULL,
>   `width` int(11) default NULL,
>   `thumbnail` varchar(255) default NULL,
>   `title` varchar(150) default NULL,
>   `description` text,
>   `location` int(11) unsigned default NULL,
>   `uploaded_by` int(11) default NULL
> ) TYPE=MyISAM;
>
> uniqueid is the id of the folder.
> gallery is the folder depth (0=photo, 0=main folder, 1=sub folder level 1,
> 2==sub folder level 2...)
> location is the folder this sub-folder is located in
>
> Seems this code may be fairly complex.  I've made about three attempts,
with
> no success and I figured this would be the best place to ask.
>
> Any help would be appreciated.
>
> -Tom Reed
> [EMAIL PROTECTED]

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



[PHP-DB] Recursive photo gallery removal problem.

2004-03-24 Thread Tom Reed
I designed a photo gallery system, in which I allow users to create
recursive photo "folders."  The trouble I am having is being able to delete
a photo folder, and all folders/photos within it.

Example structure:

Main Folder
  - Folder 1
 - Folder a
 - Folder b
 - Folder i
 - Folder ii
   - Folder aa
   -Folder bb
  - Folder 2
  - Folder 2a
   ...

I am having trouble creating code to delete all folders within the folder
they choose to delete.

Say I want to delete "Folder b."  In addition to deleting "Folder b," the
code also needs to delete folders "Folder i," "Folder ii," "Folder aa," and
"Folder bb."

Here's how I've setup the photo gallery table:

CREATE TABLE `gallery` (
  `uniqueid` int(11) unsigned default NULL,
  `gallery` int(11) default NULL,
  `image` varchar(255) default NULL,
  `height` int(11) default NULL,
  `width` int(11) default NULL,
  `thumbnail` varchar(255) default NULL,
  `title` varchar(150) default NULL,
  `description` text,
  `location` int(11) unsigned default NULL,
  `uploaded_by` int(11) default NULL
) TYPE=MyISAM;

uniqueid is the id of the folder.
gallery is the folder depth (0=photo, 0=main folder, 1=sub folder level 1,
2==sub folder level 2...)
location is the folder this sub-folder is located in

Seems this code may be fairly complex.  I've made about three attempts, with
no success and I figured this would be the best place to ask.

Any help would be appreciated.

-Tom Reed
[EMAIL PROTECTED]

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



[PHP-DB] Re[2]: [PHP] Enum table entry

2002-10-19 Thread Tom Rogers
Hi,

Saturday, October 19, 2002, 5:15:41 PM, you wrote:
JN> You know, I didn't even think about serializing the array.  I have a 
JN> table set up for spells, one for schools, and a linking table using the 
JN> spell id and the school id(s).  I could have done without the linking 
JN> table.  Some of you people are pretty freakin' smart. :)

JN> One note though, when you pull the serialized data out, you may have to 
JN> stripslashes before unserialize...

JN> $school = unserialize ( stripslashes ( $row['school'] ) );

JN> Tom Rogers wrote:
>> Hi,
>> 
>> Saturday, October 19, 2002, 2:48:14 PM, you wrote:
>> SM> Have a question that im trying to figure out how to resolve. I have a field 
>type in mysql that is of the enum type. Unless youre familiar with Dungeons and 
>Dragons, you wont get what the values
>> SM> mean, but hopefully youll get the gist anyway. I have a column labelled school 
>which holds an enum data type comprised of the values 1 through 40. From the website 
>front end, where the data is
>> SM> being entered, i want to display, ideally a series of checkboxes, otherwise a 
>list which would allow a user to select multiple items in that will translate into 
>this enum field. For instance, a
>> SM> series of checkboxes with items such as abjuration, conjuration, divination, 
>and others, which will all have a numeric value which gets plugged into the enum 
>field. for instance, if a user
>> SM> selected abjuration, and divination, it would be plugged into sql as 1, 3 (or 
>however enum data is input into its column). That being the case how do i utilize php 
>to get this to work? what
>> kind
>> SM> of form elements etc... The problem im seeing with checkboxes are that they are 
>discreet and dont group together, so i cant get all the data to go into one column in 
>mysql. Hopefully i havent
>> SM> horribly confused the issue and some kind soul out there can tell me how to 
>send this data across. As a double nice thing...how would you write it to pull the 
>data back out...ie, convert 1, 3
>> to
>> SM> show abjuration, divination? Thanks for the help in advance. 
>> 
>>  I have never used enum type but I am sure it is not what you want as
>>  it will only store one item from a predefined list not a list of
>>  items. What you need to do is create an array of the selected items,
>>  serialize() it to store in the database in a varchar or mediumtext if
>>  it going to get big. Then when you read it back unserialize and loop
>>  through all the options setting "checked" if it is in the array.
>>  To keep the checkboxes grouped name them like this:
>>  
>>  
>>  
>> 
>>  That will show up as an array under $_POST['school']
>>  so you can serialize it as is and store it.
>> 
>>  >  if(isset($_POST['school'])) $school = serialize($_POST['school']);
>>  ?>
>> 
>>  Playback is simple too
>> 
>>   >   $school = unserialize($row['school']);
>>   for($i = 1;$i < 41;$i++){
>>  echo '>  if(isset($school[$i])) echo ' checked';
>>      echo '>';
>>   }
>> 
>>   Un-checked boxes are not returned in the post and checked ones
>>   return Yes I think.
>> 
>> 
>> 

As the only thing going in is 1->yes add and strip isn't needed. You
should never need to stripslashes on db output under normal
conditions. If the data could contain single quotes and stuff then you would do it like
this

addslashes(serialize($_POST['school']));

-- 
regards,
Tom


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




[PHP-DB] Re: [PHP] Enum table entry

2002-10-18 Thread Tom Rogers
Hi,

Saturday, October 19, 2002, 2:48:14 PM, you wrote:
SM> Have a question that im trying to figure out how to resolve. I have a field type 
in mysql that is of the enum type. Unless youre familiar with Dungeons and Dragons, 
you wont get what the values
SM> mean, but hopefully youll get the gist anyway. I have a column labelled school 
which holds an enum data type comprised of the values 1 through 40. From the website 
front end, where the data is
SM> being entered, i want to display, ideally a series of checkboxes, otherwise a list 
which would allow a user to select multiple items in that will translate into this 
enum field. For instance, a
SM> series of checkboxes with items such as abjuration, conjuration, divination, and 
others, which will all have a numeric value which gets plugged into the enum field. 
for instance, if a user
SM> selected abjuration, and divination, it would be plugged into sql as 1, 3 (or 
however enum data is input into its column). That being the case how do i utilize php 
to get this to work? what kind
SM> of form elements etc... The problem im seeing with checkboxes are that they are 
discreet and dont group together, so i cant get all the data to go into one column in 
mysql. Hopefully i havent
SM> horribly confused the issue and some kind soul out there can tell me how to send 
this data across. As a double nice thing...how would you write it to pull the data 
back out...ie, convert 1, 3 to
SM> show abjuration, divination? Thanks for the help in advance. 

 I have never used enum type but I am sure it is not what you want as
 it will only store one item from a predefined list not a list of
 items. What you need to do is create an array of the selected items,
 serialize() it to store in the database in a varchar or mediumtext if
 it going to get big. Then when you read it back unserialize and loop
 through all the options setting "checked" if it is in the array.
 To keep the checkboxes grouped name them like this:
 
 
 

 That will show up as an array under $_POST['school']
 so you can serialize it as is and store it.

 

 Playback is simple too

  ';
  }

  Un-checked boxes are not returned in the post and checked ones
  return Yes I think.



-- 
regards,
Tom


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




[PHP-DB] Problem after upgrading to PHP 4.2.3

2002-10-10 Thread Schnittker, Tom

I recently upgrade to PHP 4.2.3 and started having problems with one of my
applications.  I have a PHP application that interfaces to a MySQL DB
(version 3.23) all running on an Apache web server (1.3) under Linux 7.  Up
until doing the upgrade, everything had been working fine.  Now on a daily
basis, the MySQL server has started exceeding the max_connections.  I
doubled the number and again exceeded it.  Being somewhat of a novice with
all of this, I am somewhat at a loss as to where to look to identify the
problem.  Any suggestions that anyone can give me would be greatly
appreciated.

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




[PHP-DB] Re: [PHP] New Question...tables

2002-09-26 Thread Tom Rogers

Hi,

Friday, September 27, 2002, 10:20:32 AM, you wrote:
SM> Thanks to Micah Ive resolved my old problem, but now im working on something new 
and fairly gnarly...i ahve a data entry form and one of the textareas on the form 
needs to have the ability to
SM> take a table...from users who dont know html. does anyone know any possible 
solutions to this dilemma? It would be easy if the field would always have a table 
with specific properties, but that
SM> is not the case, there may or may not be a table and the number of rows and colums 
used and data input into the table if it does exist will vary from record to record. 
Is there any way to
SM> accomplish this tha tyou can think of? Im almost certain that there is nothing 
quick and easy but i was wondering if anyone out there had ideas. Just FYI i plan on 
having a seperat page to view
SM> data with that will pull the data out of a table, and, ideally format the html 
into a table for display. 

Have them enter the data as a comma delimited list like this:

[table]
Name,Address,City,Country
Tom,Home,Brisbane,Australia
...
[/table]

Then you could parse looking for [table] and work on the data after till
[/table] The first row would be the column headers.

-- 
regards,
Tom


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




[PHP-DB] Filesystem functions and mysql

2002-03-19 Thread tom hilton

Hi, I'm working on a website for a local tennis group, and we are raising
money to offset website costs through sponsorships.  I have created some 15
and 30 second GIF's for the sponsors, and would like to create a function
that loads the files in random order when the page is opened.  I am creating
a mysql table with file number, file location, file name info, that will be
pulled when the page loads.  I know there are random number functions I can
use, but I haven't ever worked with the filesystem functions.  What
functions would I need to first open the selected file, then move on to the
next file  in the array, once the previous one has closed, and then continue
looping through this array of files until the page is closed?  Any
suggestions or help would be greatly appreciated.



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




[PHP-DB] 2 mysql connections to same server?

2002-03-05 Thread Tom

Hi,

does anyone know how to make multiple database connections to the same
server without getting the same Resource-ID back from the "mysql_connect" ?

I´m trying to write an abstract database class. I want to be able to have
different instances for every connection. For example one connection for
session handling and another one for normal database interaction. But
connecting to the same server (different database) a second time kinda
overwrites my previos connection and gives back the same resource id.

Thanks for help,
Tom



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




[PHP-DB] left joins and mysql

2002-01-31 Thread tom hilton

Hi,

I am trying to do a left join on a "master" table, but I don't want to pull
all the records from this table.  Can anyone tell me the syntax for using a
WHERE or equivalent on the master table before left joining the slave table?
Is this possible, or do I have to pull all the records from the master?  I
have a table called "team" that is the master, I want to join a table called
"player" on it, but I only want teams that belong to one particular league
(flight_id), not all teams (there are eight flights in the "team" table).
Below is the basic syntax I am using now, and it is pulling all the teams
from the team table, not just the teams where flight_id=1.  Is there
someplace after the "join" that I can restrict "team" records using a WHERE
statement?  Sorry if this is confusing.

$big_join=mysql_query

SELECT team.team_name,team.flight_id,player.player_fname,player.player_lname

FROM team left join player on team.flight_id=1 and
team.team_id=player.player_team_id and
team.flight_id=player.player_flight_id and player.player_status='captain'

ORDER by team.flight_id

or die("no friggin way")




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Updating a value usins MsAccess db?

2002-01-10 Thread Tom

I was just wondering if anybody knew how to update values using an access
db? (using odbc_exec()?). I have it all setup to display the results, just
cant seem to update it, I always get errors. Heres my code:

if($da != 0)
 {

  $cnx = odbc_connect( 'a' , $u, $p );
   if( ! $cnx )
 { echo "Error in odbc connect"; }

  $cur= odbc_exec( $cnx, "UPDATE weekno SET Date=$da" );
   if( ! $cur )
   { echo "Couldnt return curser"; }



  odbc_close( $cnx);

  $dat =  $da;

 }

I get

Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error
in UPDATE statement., SQL state 37000 in SQLExecDirect in
c:\inetpub\wwwroot\dbtest.php on line 19

thanks
--tom



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Protecting php scripts from source being downloaded

2002-01-09 Thread Tom

sorry, as I said Im kinda new, I was downloading the file from my webserver
to my computer, and it downloaded the php file as a php file, non parsed by
the preprocessor. But when other people download it it does only give the
source

sorry :)

"Neil Thomson" <[EMAIL PROTECTED]> wrote in message
003e01c19933$7300d220$113331d2@home">news:003e01c19933$7300d220$113331d2@home...
> u can download a php page from a download manager ? i just tryed with
> flashget... & it phrased the php page into html first.. ? ?
>
> if you want to protect your say.. variables file from some1 trying in the
> address of it. heres a simple way. in the variables file include
> @header(status: error 404); (or how ever that code goes). then in the page
u
> want to include this. start the html tag first  then include this
> page. the @ will make it not report errors. so u can inclue the page
> perfectally.. & when people try to look @ it, it will say it doesnt exist.
>
> Neil
>
> - Original Message -
> From: Tom <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, January 09, 2002 8:00 AM
> Subject: [PHP-DB] Protecting php scripts from source being downloaded
>
>
> > Hi, im kinda new to this so be kind :)
> >
> > Im using mysql and php to create test databases (guestbook etc, basic
> > stuff), but it doesnt seem so secure, people can just use a download
> manager
> > to download the php files and steal the mysql passwords. Is there anyway
> to
> > make it so they can see the php files through the brower but not
download
> my
> > homecrafted php?
> >
> > Ive looked through many websites and the history of this, all I could
find
> > was one post which was to encript the files (this isnt really suitable
for
> > me as I edit bits and bobs as I go along). Is there anyway I can setup
> > access as said in the above? Or just hid the password somehow? Im using
> IIS
> > 5.1.
> >
> > thanks
> > tom
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Protecting php scripts from source being downloaded

2002-01-09 Thread Tom

Hi, im kinda new to this so be kind :)

Im using mysql and php to create test databases (guestbook etc, basic
stuff), but it doesnt seem so secure, people can just use a download manager
to download the php files and steal the mysql passwords. Is there anyway to
make it so they can see the php files through the brower but not download my
homecrafted php?

Ive looked through many websites and the history of this, all I could find
was one post which was to encript the files (this isnt really suitable for
me as I edit bits and bobs as I go along). Is there anyway I can setup
access as said in the above? Or just hid the password somehow? Im using IIS
5.1.

thanks
tom



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Database Security

2002-01-07 Thread Tom Oram

Hi,
We have developed a PHP security extension, it was originally developed to make
it possibly to store you database password securly!!! So I thought I'd post a
copy of the email I posted to the dev list to this list as well.

Here it is
==
Maybe one or two of you may have read a post a while back about a PHP security
extention called Scripthash. For those of you who can't remember or don't know
this extension it lets you solve the age old problem of hardcoding passwords in
your PHP scripts and also makes it possible to execute scripts from PHP as a
different user (or even root) safely! This extension can ONLY be used when you
are using PHP as an Apache module on a Unix/Linux platform.

The original version was hard to install as you would have to compile it into
PHP. It also had some major bugs, the new version 0.5 has all previously known
bugs fixed and some new features. Scripthash 0.5 is for PHP 4.1.x (only tested
with 4.1.1) but users of PHP 4.0.x can download Scripthash 0.4 which is exactly
the same but made to run with 4.0.x.

The new version is very easy to install, all you need to do is either download
the tarball or the RedHat Source RPM and build then install. Then add the
following lines to you php.ini

 extension_dir=/usr/lib/php/extensions
 extension=scripthash.so

then restart Apache. To confirm everything it is working make a script with a
call to the phpinfo() function and there should now be a section called
Scripthash. To use the extenstion see README.html

To use some extended functionality you have to patch the PHP source code then
rebuild it. This patch will give you two new PHP globals called $VIRTUAL_UID
and $VIRTUAL_GID which contains the user id and the group id of the virtual
server being hit, you don't have to do this but you will get more control with
scripthash.

Finally I'll tell you what I hope to get from posting this message, I would
just like to see some interest, bug reports, suggestions, comments and maybe
some well written scripthash daemons (see README.html) :). I think this is an
extremely useful piece of code and it is now stable and easy to use.

You can get/find out more about Scripthash at
http://www.scl.co.uk/scripthash/ Sadly we have not had the time to update the
documentation for this module but it is on our TODO list and in the mean time
we are happy to reply to and emails you send us.

Thanks for your time
Tom

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] php bulletin/dicussion board

2001-11-01 Thread Tom Hodder


Hi,

can anyone recommend a good php discussion/bulletin board thats free, as I
need to choose one and have been over whelmed by the variety available.

Cheers

Tom Hodder


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MySql special characters (éàôï)

2001-10-04 Thread Tom Landry

Hi !

My question is pretty simple. How do I specify a language for MySQL ? I
cannot retreive (or correctly insert, i'm not sure) any accentuated
characters (french canada) from my database with php, ODBC or the mysql
client. I may be a little off-topic, but it's pretty important for me to be
able to display these characters on my webpage.

Thank you



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Appending to a CLOB

2001-09-25 Thread Tom Tsongas

Hi folks.

I am attempting to 'append' information to an Oracle CLOB and I seem to
be hitting snags everytime I try. We have a stored procedure for
appending to the CLOB but I can't seem to run it through the parser.

Here is the code in question:

// Append comment code
$clob = OCINewDescriptor($connection, OCI_D_LOB);
$sql1 = ("begin append_comments(:incident_id,:comments_id);end;");
$sth = OCIParse ( $db, $sql1 ) or die("Couldn't parse statement.");
OCIBindByName ( $sth, ":incident_id", &$incident, 10 );
OCIBindByName ($sth, ":comments_id", &$clob, -1, OCI_B_CLOB);
OCIExecute ( $sth ) or die("Couldn't execute statement.");
$clob->save($comments);

(Note that both $incident and $comments are brought in via a POST method
from an adjacent page)

The error I am getting is:

Warning: Supplied argument is not a valid OCI8-Connection resource in
/www/htdocs/Etrack/oracle_update.php on line 66
Couldn't parse statement.

Help!!

Tom Tsongas



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] db's war

2001-09-18 Thread Tom Carter

Having worked in IBM and in Open Source community I feel I've know both
systems very well.

MySQL is different to the "big boys" of DB2 and Oracle. They are designed
for enterprise level, and to handle a complexity and quantity of data which
mysql just isn't there. The SQL used in mysql is vastly simpler than that
used in the others, and could be said to less powerful in that in can do
much less. This leads on to what I feel is the key point here, mysql place
has not been in doing in enterprise level stuff, it has been in providing a
good simple way of doing simpler things. Because of its simplicity it
manages to be very effecient,  but when you start trying to build it more
complex the obvious flaws in the language.
I'm eagerly awaiting the next release of mysql to see what they do with it.
I think they will either stick to how it as at the moment and further
improve performance and the basic features or are they going to take a step
up (and away) from where they are at the moment and start to see more
complex features (maybe even sub-selects. now that I *would* like to see
in there). Either way I don't think mysql competing with db2 or oracle, at
least in the reasonably long future, is all that likely. The customer base
and trust is there too strong + the products are actually decent (which is
where any analogy between ASP and PHP breaks down ;) )

As in almost everything in IT, and I life I guess, it's a case of best tool
for the job.

Well, there's my ha'penny's worth.

Anyone want to start a DB2 / Oracle debate? (JOKE been there done that,
neither won)

Tom
- Original Message -
From: "Sommai Fongnamthip" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 18, 2001 2:36 AM
Subject: [PHP-DB] db's war


> hi
> I'd like to survey php commnunity about how do you think about merge
> between informix and ibm?  Did there remain only 2 major dbms (oracle and
> db2)?  do you think MySQL will be the leader with next version 4?
>
> SF
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] USA Attacks

2001-09-12 Thread Tom Carter

now isn't the time for these kind of discussions, and nothing can excuse the
death of all those innocent people. America as a nation is far from innocent
however, I agree with you on that Lars.

My sincerest condolances to all those involved.

Let's just hope that the crazy man bush doesn't do anything stupid

> It is replies like this that makes me understand the terrorism in the
> world...
>
> No doubt, it was a horrible act by cowards, but what comes up must come
> down. US has been playing with fire once too often and suddenly tasted
their
> medicine - maybe time to rethink the "world police" strategy again.
>
> I feel sympathy for all who died in the incident for no cause. Dont get me
> wrong on that point !
>
> / LJ
>
> -Original Message-
> From: Bartek Pawlik [mailto:[EMAIL PROTECTED]]
> Sent: 12. september 2001 14:35
> To: [EMAIL PROTECTED]
> Subject: Odp: [PHP-DB] USA Attacks
>
>
> My deepest sympathy to all Americans,
>
> It's horrible, I can still believe it.
> Kill everyone who is involved into these attacks
>
> Bartek Pawlik
> Poland
> - Original Message -
> From: Steve Farmer <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, September 12, 2001 4:28 AM
> Subject: [PHP-DB] USA Attacks
>
>
> > Hi,
> >
> > My heart goes out to all our American cousins in their time of tragedy.
> >
> > Steve Farmer
> > --
> > ---
> > "Minds are like parachutes, they work best when open"
> > Support free speech; visit http://www.efa.org.au/
> >
> > Heads Together Systems Pty Ltd http://www.hts.com.au
> > Email: [EMAIL PROTECTED] Tel: 612 9982 6767 Fax: 612 9981 3081
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
>
> Zagraj z finalistkami
> Miss Polonia [ http://miss.onet.pl/start.html ]
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Backups, best practices

2001-09-07 Thread Tom Carter


> you can get command line zip/compression packages for windows, although
for
> *some* reason, as far as i know, not a command line version of winzip -
the
> big one!

err.. please correct me if I'm wrong, but isn't pkzip exactly that? or more
exactly, winzip is a windows interface to it? it certainly uses the same
compression
>
> anywho, all of those should be able to be scheduled using the "at" command
> from DOS (good old DOS... the closest a microsoft weenie will come to
heaven
> (*nix) :P)
>
> HTH
>
> Beau
>
> // -Original Message-
> // From: Dan Brunner [mailto:[EMAIL PROTECTED]]
> // Sent: Friday, 7 September 2001 2:33 AM
> // To: Jacob Singh
> // Cc: [EMAIL PROTECTED]
> // Subject: Re: [PHP-DB] Backups, best practices
> //
> //
> // Hey Hey Hey!!!
> //
> // That depends on what system your running!?!?!?
> //
> // I run LinuxPPC and use 3 ways
> //
> // 1. Bru Tape back system
> //
> // 2. At 12:00 AM the shell script runs and copies the files..
> //
> // 3. Once a month I manually copy the files to a zip.
> //
> //
> // Dan
> //
> //
> //
> // PS WindowsGood luck.
> //
> //
> // On Thursday, September 6, 2001, at 09:22 AM, Jacob Singh wrote:
> //
> // > Hello,
> // >
> // >   I'm just wondering how everyone manages their MySQL backups, I'm
> // >   looking for a better solution than manual.  any scripts
> // or example
> // >   would be especially appreciated. tnks
> // >
> // > --
> // > Best regards,
> // >  Jacob Singh
> // >  Pajama Design
> // >  (413)582-9342
> // >  2 Belanger Pl.
> // >  Northampton, MA 01060
> // >
> // > mailto:[EMAIL PROTECTED]
> // >
> // >
> // > --
> // > PHP Database Mailing List (http://www.php.net/)
> // > To unsubscribe, e-mail: [EMAIL PROTECTED]
> // > For additional commands, e-mail: [EMAIL PROTECTED]
> // > To contact the list administrators, e-mail:
> // [EMAIL PROTECTED]
> // >
> //
> // --
> // PHP Database Mailing List (http://www.php.net/)
> // To unsubscribe, e-mail: [EMAIL PROTECTED]
> // For additional commands, e-mail: [EMAIL PROTECTED]
> // To contact the list administrators, e-mail:
> // [EMAIL PROTECTED]
> //
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] SQL combine to summations queries?

2001-09-06 Thread Tom Carter



> Hello,
> 
> I don't understand the following, who can help?
> 
> I have got two queries:
> SELECT SUM(fielda) FROM table1
> and
> SELECT SUM(fieldb) FROM table2
> 
> I thought this would be the same as:
> SELECT SUM(fielda.table1),SUM(fieldb.table2)   FROM table1, table2.
> But, itn't, why?

I think you mean table1.fielda rather than fielda.table1.

> Tnx,
> 
> Bas Jobsen
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] implementing php with IBM branded apache

2001-09-05 Thread Tom Carter

What OS are you running on it? I've used php on an rs6000 while at IBM.
worked fine, I didn't install it tho, but I don't think they had any
problems.

HTH, Tom
- Original Message -
From: "Marc Grober" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 05, 2001 6:09 PM
Subject: [PHP-DB] implementing php with IBM branded apache


> We are using the IBM branded apache on an rs6k. I would like to add php
> functionality.  Is there some way to add the php module? As I understand
> it, I can still use php it just won;t be compiled into apache ???
> marc grober
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Error inserting CLOB

2001-08-30 Thread Tom Tsongas

Hi folks.

I am getting a bizarre error when trying to insert CLOB data into my
Oracle 9i database. (Using PHP4 on Apache 1.3.20) Error refers to a
missing 'comma'?! Here is the exact error:

Warning: OCIStmtExecute: ORA-00917: missing comma in
/www/htdocs/Etrack/oracle_operations.php on line 52
Couldn't execute statement.

Here is the code:

// Set Clob variable
$clob = OCINewDescriptor($connection, OCI_D_LOB);

$sql = "INSERT INTO INCIDENT (incident, project,
 abstract, owner, reporter, state, priority, severity,
type,
 open, supportinc, product,
 version, build, component, comments)
 VALUES (INCIDENT_SEQ.NEXTVAL, '$project',
 '$textfieldabstract', '$owner', '$reporter', '$state',
'$priority', '$severity',
 '$type', TO_DATE(SYSDATE, '/MM/DD HH24:MI:SS'),
 '$supportinc', '$product',
 '$version', '$build', '$component',comments =
empty_clob()) returning comments into :commentstemp";

// parse SQL statement
$clob = OCINewDescriptor($connection, OCI_D_LOB);
$sql_statement = OCIParse($connection,$sql) or die("Couldn't parse
statement.");
OCIBindByName ($sql_statement, ":commentstemp", &$clob, -1, OCI_B_CLOB);

// execute SQL query
OCIExecute($sql_statement,OCI_DEFAULT) or die("Couldn't execute
statement.");
$clob->save($comments);
// Commit Statement
$result = OCICommit($connection);

The SQL statement works fine when I remove the CLOB portion so I know
the rest is correct.

HELP
Tom Tsongas





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Tablename issue..

2001-08-29 Thread Tom Wallace


 Tried this - same errors --  Also tried the following permutations
(courtesy of Trevor Lanyon) --

You can try to encapsulate the table name with hard bracket
[Table - Name]

You can escape the character with a slash (I don't think this will work):

Table\ \- Name

You can escape the characters with the hexidecimal url encoding (I know this

only to work with one try of database, and I think the client is actually

stripping it off)

Table%20%2D%20Name



The ODBC source I'm trying to connect to is a Remedy (Action Request System)
4.5 system running on top of a Oracle 8 database.

Thanks - Tom

"Ryan Marrs" <[EMAIL PROTECTED]> wrote in message
EA9290E62E6CD311859200805F85164902FB13DE@EXCHANGE">news:EA9290E62E6CD311859200805F85164902FB13DE@EXCHANGE...
> Try putting Brackets [] around the spaces.  This will typically fix the
> problem, ie:
>
> $sql2 = odbc_exec($conn,"SELECT [Character Field] FROM [ABC - Table]");
>
> Let me know if it works!
>
> Ryan
>
> -Original Message-
> From: Tom Wallace [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 29, 2001 3:06 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Tablename issue..
>
> Hola,
>
>   I'm having a difficult time figuring out the syntax here -- my table
name
> has spaces & dashes in it..Unfortunately I can't permanently change the
> tablename.. I've tried a half dozen different ways to access the table,
each
> return an error similar to this:
>
> Warning: SQL error: [ISAM]No data found, SQL state S00 in SQLExecDirect in
> c:\inetpub\wwwroot\test8.php on line 14
>
> but removing the spaces from the tablename and updating the php fixes it..
>
>  any ideas?
>
> $sql2 = odbc_exec($conn,"SELECT Character_Field FROM ABC - Table");
>
> Thanks,
> -Tom
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Tablename issue..

2001-08-29 Thread Tom Wallace

Hola,

  I'm having a difficult time figuring out the syntax here -- my table name
has spaces & dashes in it..Unfortunately I can't permanently change the
tablename.. I've tried a half dozen different ways to access the table, each
return an error similar to this:

Warning: SQL error: [ISAM]No data found, SQL state S00 in SQLExecDirect in
c:\inetpub\wwwroot\test8.php on line 14

but removing the spaces from the tablename and updating the php fixes it..

 any ideas?

$sql2 = odbc_exec($conn,"SELECT Character_Field FROM ABC - Table");

Thanks,
-Tom




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Accessing Oracle 9i locally

2001-08-28 Thread Tom Tsongas

Hi folks.

Up til now I have been using PHP code on my NT Server running Apache to
access an Oracle 9i database remotely. Everything works fine but now I
will be migrating my files to an Apache server on the same machine as
the Oracle database. My code currently access the database through
TCP/IP but since the mechanism will be local now, I am wondering how
that will be accomplished. Can it be done through IPC and if so, what is
the notation?

Currently, my connection code is as follows:

$db = " (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = $host)(PORT =
1522))(CONNECT_DATA = (SID = etrack9i)))";
$connection = ocilogon("system","manager",$db);

How should the above look if its a local connection?

Tom Tsongas



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: ORA-12541: TNS:no listener error

2001-08-22 Thread Tom Tsongas

Joe,

I built PHP with oracle and oci8 extensions. I built it as a static module for
Apache 1.3.20.
If you are getting errors from running 'configure' (something like it can't
locate the Oracle libraries) its because the Oracle 8 library searched for is
hard coded as libclntsh.so.8.0 corresponding to the older oracle library.
If you create a symbolic link to the oracle 9 library as follows:

ln libclntsh.so.9.0 libclntsh.so.8.0

it will compile and build.

Tom


Joe Casey wrote:

> What module did you build PHP with? We tried rebuilding PHP 4.06 with oci8
> after upgrading to 9i and apparently the client libraries were missing. Am I
> missing something?
>
> Tom Tsongas wrote:
>
> > Hi folks.
> >
> > My group recently switched from an 8i to a 9i database. I recompiled
> > PHP4.0.6 against Oracle 9i and everything went smoothly. However, when I
> > attempt to execute my PHP code, I get the following error:
> >
> > ORA-12541: TNS:no listener
> >
> > My database admin says that the connection information is accurate. Is
> > there something new I have to do with 9i?
> >
> > Tom
>
> --
> Joe


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] ORA-12541: TNS:no listener error

2001-08-22 Thread Tom Tsongas

Hi folks.

My group recently switched from an 8i to a 9i database. I recompiled
PHP4.0.6 against Oracle 9i and everything went smoothly. However, when I
attempt to execute my PHP code, I get the following error:

ORA-12541: TNS:no listener

My database admin says that the connection information is accurate. Is
there something new I have to do with 9i?

Tom



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] phpMyAdmin (well mySQL) and listing DB's

2001-08-19 Thread Tom Carter

Hi All,

I was trying to set up phpMyAdmin for a client on my machine, and I've
created a mysql account for him such that he can only use his database, yet
when I use phpMyAdmin (with the correct setting) he can see all the
databases. The security is still there, it just looks messy + reveals all
the dbs.

Anyone have any advice?

TIA, Tom
Tom Carter
Web Architect
roundcorners ltd.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Include

2001-08-19 Thread Tom Carter

   Yes that is correct. On a security point of view therer is something
extra you can do.. when using require you can require files that are outside
the web tree...by this I mean are not accessible thru the internet. So if
you site was in /home/web then you could setup a directory, say
/home/web_vars and in this put these kind of files.

In the require statement you just then simple put in the full path, eg
require("/home/web_vars/vars.php");

The advantage of doing this is security When the file with such sensitive
information is included in the web tree then there are (admittedly limited)
possible scenarios in which this could be compramised. It is generally
accepted that it is sensible to avoid putting such information in the web
tree.

Hope I've been clear, let me know if you need any more advice.

> so in var.php i will put something like this
>
> $db="mydatabse";
> $username="myusername";
> $password="mypassword";
>
>
> and so on?
>
>
> --
> Cross Walk Central
> www.crosswalkcentral.net
> Support Center
> Your Web Hosting Community!
>
> "Seb Frost" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > chuck all the common variables in var.php
> >
> > then just put
> >
> >  > require("var.php");
> > ?>
> >
> > - seb
> >
> > -Original Message-
> > From: CrossWalkCentral [mailto:[EMAIL PROTECTED]]
> > Sent: 19 August 2001 03:18
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] Include
> >
> >
> > OK here is one for you folks that know what you are doing.
> >
> > I am making a script and I have about 5 php files in it. That have alot
of
> > the same system variables can I create one file with these settings in
it
> > and if so any one want to give me some hints on this
> >
> > thanks again.
> >
> > --
> > Cross Walk Central
> > www.crosswalkcentral.net
> > Support Center
> > Your Web Hosting Community!
> >
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: mcrypt, postgres, only returning half the data

2001-08-15 Thread Tom Henry

John

A second question to answer, it's not clear from your description --- is 
the encryption 'breaking' during en-cryption  (before it stuffs the 
value into the database) so that all the data is not even getting into 
the database?  -or-  is ir breaking during  de-cryption ?

Sounds to me like it might be a control character is getting interpreted 
by PgSQL and cutting off the query.

You don't mention - what type field to save the encrypted data???  If 
there's a "blob" or "binary" field type (I dunno about PgSQL) try using 
that field type for encoded data.

And - try skipping the add slashes step - what happens???

Good luck,
Tom Henry


John Starkey wrote:
> Hello all
> 
> I'm working on encoding some data going in and decrypting coming out of postgres. 
>I'm adding slashes going in and stripping them coming out. Using BLOWFISH and I've 
>tried several different modes. But each time the data comes out I'm only getting 
>half-decrypted data, it seems to hang at a random spot. The same for each piece of 
>data but random in terms of different for each entry (confusing the issue enough?).
> 
> I'm using mcrypt_encrypt and mcrypt_decrypt. When I test it on the same page 
>(without going through the database) it decrypts fine, perfect as a matter of fact. 
>But coming out of the DB, the same data is trashed.
> 
> Is there any special way to send (or abstract) encrypted data into (from) the DB? 
>I've been through the archives and it doesn't look like anyone has posted a problem 
>like this. Am I the only one :}
> 
> Thanks,
> 
> John
> 
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] mail function

2001-08-14 Thread Tom Hodder



check that you have either specified

[mail function]
; For Win32 only.
SMTP = mail.myserver.com

; For Win32 only.
sendmail_from = [EMAIL PROTECTED]

or the sendmail path here;

; For Unix only.  You may supply arguments as well (default:
'sendmail -t -i').
;sendmail_path = /usr/bin/sendmail

otherwise mail cannot send mail at all.






-Original Message-
From: Travis Cannell [mailto:[EMAIL PROTECTED]]
Sent: 14 August 2001 03:27
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mail function


hi all,

I cant seem to get my mail function to work. OK so i am a noob, that might
have something to do with it.  I am using a script I found called the HTML
Mime Mail Class, which does everything i need except actually send the mail.
I am guessing that there is some config problems, but i am not sure.  Even
when i try and use the mail() function i get a server error.  So i guess
that my problem is that my return address is messed up.  Does it have to  be
my own domain, or the domain that the server is running on?  Can i set the
return address as a hotmail account, or do i need my own server mail
program?  And is there anything that i need to config in the php.ini file?

Thanks for helping,

T P K Cannell



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Show abbreviated article

2001-08-13 Thread Tom Henry


Try using MySQL to do that right in the query itself (and save the 
overhead of retreiving the whole blob then PHP'ing the blob too).

 From the MySQL Doc's   ;-)  RTFM once at least
--
SUBSTRING(str,pos,len)
SUBSTRING(str FROM pos FOR len)
MID(str,pos,len)
Returns a substring len characters long from string str, starting at 
position pos. The variant form that uses FROM is ANSI SQL92 syntax.

mysql> select SUBSTRING('Quadratically',5,6);
 -> 'ratica'
--


For your problem it might look like
$sql = SELECT field1, field2, SUBSTRING(blobfieldname,0,160) FROM 
articles where 

( BTW I usually assume prox 8 chars per word for something like this so 
20 wds x 8 char = 160 chars total  BUT you might have lots of esoterica 
in there and might want to adjust that ;-) )


HTH
Tom Henry



Cilfa wrote:
> Hi,
> 
> On my website I want to display some articles, in Slashdot style. The
> main page should only display the first 20 words of the article, and
> users should be able to click on a link to view the entire article.
> The articles are stored in a MySQL database, the body of the article in a
> blob-field.
> 
> My question is this: how can I select only those first 20 words in the
> PHP code?
> 
> I hope somebody can help me with this.
> 
> Cilfa
> 
> 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] SELECTS from multiple tables

2001-08-13 Thread Tom Hodder




Hi,


If I do a select from multiple tables like so

SELECT * FROM,
candidates,
clients,
jobs
WHERE
candidates.ID = clients.candidate_ID
etc etc

i then do

$row = mysql_fetch_array( $results )
or die(mysql_error() );

is there any way to explicitly reference table columns ie [candidates.ID] in
the result set like you can in ASP. As due to poor table column naming,
there are numerous column name duplications across the tables and it would
take ages to add the

SELECT candidates.ID as canID, client_ID as cliID

to the queries.

Regards

Tom Hodder






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: NEXT - PREVIOUS coding

2001-08-13 Thread Tom

Hi,
what about other possibilities to do this ?

Tom

U¿ytkownik "Manuel Lemos" <[EMAIL PROTECTED]> napisa³ w wiadomo¶ci
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hello Pranot,
>
> On 16-Jul-01 06:09:33, you wrote:
>
>
> >hi.. friends
>
> >i have a database (mysql) in which their r many records. Through PHP i
want
> >them to display on the page.
>
> >Main requirement is that there should be a NEXT - PREVIOUS facility. So
if
> >there r 20 records and suppose only 10 should show up on scren at a time,
> >then a NEXT link should be visible which could show the remaining 10
records.
>
> >Their can be n no. of records.
>
> Maybe you would like to try this PHP class that does exactly what you are
> asking.
>
> http://phpclasses.UpperDesign.com/browse.html/package/130
>
>
> Regards,
> Manuel Lemos
>
> Web Programming Components using PHP Classes.
> Look at: http://phpclasses.UpperDesign.com/?[EMAIL PROTECTED]
> --
> E-mail: [EMAIL PROTECTED]
> URL: http://www.mlemos.e-na.net/
> PGP key: http://www.mlemos.e-na.net/ManuelLemos.pgp
> --
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Oracle CLOBs and carriage returns

2001-08-09 Thread Tom Tsongas

Thanks Anthony. The  tags worked perfectly!

Tom


Anthony Carlos wrote:

> Tom:
>
> I suspect that your problem is with the HTML, not the CLOB itself. Have you
> tried echoing $lob_data in between  tags or using the nl2br function in
> PHP? It converts nl's to  tags.
>
> Hope it helps,
>
> Anthony
>
> -Original Message-
> From: Tom Tsongas [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 09, 2001 2:09 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Oracle CLOBs and carriage returns
>
> Hi folks.
>
> I have an interesting problem with regards to data I am retrieving from
> a CLOB stored in my database.
>
> The data consists of several paragraphs of information with multiple
> carriage returns and other formatting mechanisms.
>
> Now when I attempt to retrieve the data and display it on the web page,
> it comes out as one giant line and all carriage returns and tabbing
> seems to have been obliterated.
>
> Here is the code I am using:
>
> $sql_comments = OCIParse($connection,"SELECT COMMENTS FROM INCIDENT
> WHERE INCIDENT='$incident'");
> OCIExecute($sql_comments);
> while ( OCIFetchInto($sql_comments, $row, OCI_ASSOC+OCI_RETURN_NULLS)) {
>
> $lob_data = $row["COMMENTS"]->load();
> echo $lob_data;
> }
>
> I know the information is stored correctly since a SQL query from the
> command line works properly and all formatting is displayed.
>
> Any thoughts?
>
> Tom
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Oracle CLOBs and carriage returns

2001-08-09 Thread Tom Tsongas

Hi folks.

I have an interesting problem with regards to data I am retrieving from
a CLOB stored in my database.

The data consists of several paragraphs of information with multiple
carriage returns and other formatting mechanisms.

Now when I attempt to retrieve the data and display it on the web page,
it comes out as one giant line and all carriage returns and tabbing
seems to have been obliterated.

Here is the code I am using:

$sql_comments = OCIParse($connection,"SELECT COMMENTS FROM INCIDENT
WHERE INCIDENT='$incident'");
OCIExecute($sql_comments);
while ( OCIFetchInto($sql_comments, $row, OCI_ASSOC+OCI_RETURN_NULLS)) {

$lob_data = $row["COMMENTS"]->load();
echo $lob_data;
}

I know the information is stored correctly since a SQL query from the
command line works properly and all formatting is displayed.

Any thoughts?

Tom



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] How to tell if a mysql table is locked

2001-08-07 Thread Tom Hodder


I have a crontab job that locks a mysql table as it needs to process the
information in it only once. But subsequent scripts don't timeout, they just
sit and wait. Is there any way of telling if a mysql table is locked?


Thanks

Tom Hodder


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] OCI support not functioning

2001-08-07 Thread Tom Tsongas

Hi folks. I posted on the install board but I figured I would run this
by the guru's here as well. :)

I am attempting to get php up and running with oracle and oci8 support
bundled in. My configure statement is as follows:

/configure --with-oci8=/oracle/product/8.1.7
--with-oracle=/oracle/product/8.1.7 --with-apache=../apache_1.3.20
--enable-track-vars

I ran make and then make install per the instructions. Next, I did the
following:

cd ../apache_1.3.20
/configure --prefix=/www --activate-module=src/modules/php4/libphp4.a
make
make install

I have altered both my php.ini and httpd.conf accordingly so I know php
is running. However, any time I attempt to utilize oci8 functions like
ocilogon, I get 'undefined' function errors. These php scripts work on
my W2K system running PHP4 with Apache.

Any ideas folks? Did I miss a step?

Thanks in advance!
Tom





-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Valid resource

2001-08-06 Thread Tom Carter

is $file the result of a fopen?
- Original Message -
From: "Wilmar Pérez" <[EMAIL PROTECTED]>
To: "PHP List" <[EMAIL PROTECTED]>
Sent: Monday, August 06, 2001 5:31 PM
Subject: [PHP-DB] Valid resource


> Hi guys.
>
> I'm getting the following error and have no idea what the hell it means:
> **
> Warning: Supplied argument is not a valid File-Handle resource in
common.php
> on line 425
>
> Warning: Supplied argument is not a valid File-Handle resource in
common.php
> on line 426
>
> Warning: Supplied argument is not a valid File-Handle resource in
common.php
> on line 427
> **
>
> the mentioned lines are:
>
> **
>   fputs ( $file, "\n");
>   fputs ( $file, "\n");
>   fclose( $file );
> **
>
> I guess many of you will ask for the full common.php file, as it is quite
a
> long one I will send it at request.
>
> Any help will be highly appreciated!
>
> Thanks
> ---
> Wilmar Pérez
>  IT Manager - Central Library
>  University of Antioquia
>Medellín - Colombia
>   tel: ++57(4)2105145
> ---
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] mail problem with ... Unbalanced '<'

2001-08-05 Thread Tom Hodder


Hi,

sorry if this is slightly off topic but I thought someone might have some
idea of the problem.

I am using the mail function like so;

mail( $to, $subject, $this->mime );

where the arguments have the following values;

print '$to = '.$to."\n";
print '$subject = '.$subject."\n;
print '$this->mime = '.$this->mime."\n";

$to = "Tom Hodder" <[EMAIL PROTECTED]>
$subject = htrheht
$this->mime = This is a MIME encoded message.

--=_ab31b28377a78eb2ae3ca4c36b9262ec
Content-Type: text/plain
Content-Transfer-Encoding: base64

RW50ZXIgeW91ciBQTEFJTiBURVhUIG5ld3NsZXR0ZXIgaGVyZS5FbnRlciB5b3VyIFBMQUlOIFRF
WFQgbmV3c2xldHRlciBoZXJlLkVudGVyIHlvdXIgUExBSU4gVEVYVCBuZXdzbGV0dGVyIGhlcmUu
RW50ZXIgeW91ciBQTEFJTiBURVhUIG5ld3NsZXR0ZXIgaGVyZS5FbnRlciB5b3VyIFBMQUlOIFRF
WFQgbmV3c2xldHRlciBoZXJlLkVudGVyIHlvdXIgUExBSU4gVEVYVCBuZXdzbGV0dGVyIGhlcmUu
DQoNCg0KDQpFbnRlciB5b3VyIFBMQUlOIFRFWFQgbmV3c2xldHRlciBoZXJlLkVudGVyIHlvdXIg
UExBSU4gVEVYVCBuZXdzbGV0dGVyIGhlcmUuRW50ZXIgeW91ciBQTEFJTiBURVhUIG5ld3NsZXR0
ZXIgaGVyZS5FbnRlciB5b3VyIFBMQUlOIFRFWFQgbmV3c2xldHRlciBoZXJlLkVudGVyIHlvdXIg
UExBSU4gVEVYVCBuZXdzbGV0dGVyIGhlcmUuDQoNCg0KRW50ZXIgeW91ciBQTEFJTiBURVhUIG5l
d3NsZXR0ZXIgaGVyZS5FbnRlciB5b3VyIFBMQUlOIFRFWFQgbmV3c2xldHRlciBoZXJlLkVudGVy
IHlvdXIgUExBSU4gVEVYVCBuZXdzbGV0dGVyIGhlcmUuRW50ZXIgeW91ciBQTEFJTiBURVhUIG5l
d3NsZXR0ZXIgaGVyZS4=

--=_ab31b28377a78eb2ae3ca4c36b9262ec--

this generates a return email with the following contents...



The original message was received at Sun, 05 Aug 2001 19:48:50 +0100

  - The following addresses had permanent fatal errors -
<"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>

  - Transcript of session follows -
... while talking to mail.globalgold.co.uk
>>> RCPT To:<"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
<<< 553 <"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>... Unbalanced '<'




I would be grateful if anyone could shed some light on this problem..

Cheers

Tom Hodder


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] #usr showing up

2001-08-04 Thread Tom Carter

why is that line in there at all? The fact that the file has a .php
extension and is going thru apache is enough... delete it and php should
work fine.
- Original Message -
From: "Vipin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, August 02, 2001 12:48 PM
Subject: [PHP-DB] #usr showing up


> Hi,
> I am running php as cgi. The top line , #/usr/bin/lib, is showing up
> on the php page when the script executes. How can I avoid this. Please
> help.
>
> Thank you,
> Vipin.
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] phpMyAdmin: delete table

2001-08-03 Thread Tom Carter

> Don't know about phpAdmin, but in straight PHP, after you've connected to
> database, etc.
>
> $sql = "drop table tablename";
> $result = mysql_query( $sql );

Do yuo use PHP anyway? the comment on that was probably it.

Otherwise, if you ahve command line access to mysql then the above SQL (DROP
TABLE tablename;) should work fine.

> if you want to test for the table before deleting use
> $sql = "drop table if exist tablename";
>
> HTH - Miles
>
> At 03:30 PM 8/3/01 +0200, thomas wrote:
> >Hi, I'm new to phpMyAdmin but they told me to use this programm to delete
a
> >table from my mysql database.
> >I've configured the file and when i try to run phpMyAdmin i can see my
> >database on the left frame, however the right frame doesn't show up at
all.
> >(instead there's a download dialog box opening all the time). When i
> >download the file and open it in notepad i get an unreadable set of
> >characters
> >
> >what should i do to delete that table??
> >
> >
> >
> >
> >
> >--
> >PHP Database Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Limit Select Field Characters?

2001-08-01 Thread Tom Carter

left(timestamp,6)
- Original Message - 
From: "Jeff Oien" <[EMAIL PROTECTED]>
To: "PHP-DB" <[EMAIL PROTECTED]>
Sent: Wednesday, August 01, 2001 11:33 PM
Subject: [PHP-DB] Limit Select Field Characters?


> I have a timestamp field that looks like this
> 0109011754
> but I only want to compare
> 010801
> when doing a SELECT. Is there a way I can do this? Thanks.
> Jeff Oien
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] writing an Oracle blob to file system?

2001-07-27 Thread Tom Anderson

I need to pull oracle blobs out of the database and write them to the file
system (Solaris).
Has anyone had any success doing this?

Tom



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] cancel <20010723135436.90722.qmail@pb1.pair.com>

2001-07-23 Thread Tom Hodder

What was all that about~??

-Original Message-
From: Christian St-Pierre [mailto:[EMAIL PROTECTED]]
Sent: 23 July 2001 16:02
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: [PHP-DB] cancel <[EMAIL PROTECTED]>


This message was cancelled from within Mozilla.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] who's logged on / how to I find out about other sessions

2001-07-23 Thread Tom Carter


Hi Christian,

What most sites do is to keep track of the latest time that a user requested
a page (ie when a page is requested store the current time).

Then a definitiion of "logged-in" is made usually this is "has requested
a page in the last 30 minutes" so the query to count the users whose time of
last access was within 30 mins of now.

Hope this makes sense,

Tom

> Hi,
>
> I'm writing a bbs/messageboard system and am trying to figure out how to
tell
> what other users are logged on.
>
> I know I could store the info in a table in my login code but then how do
I
> find out if people are logged out
> with out making them actually use a logout button or the like.
>
> I was going to do it that way but I have noticed that phpnuke sites can
list
> the number of logged in sites etc;
> but their code is a little beyond me atm
>
> Is there a way to list other session vars ?
>
> any ideas welcome
>
> with thanks
>
> Christian
>
>
> Christian Cable
> ICT Assistant
> Careers Service; Lancaster University
> Tel: (01524) 594072  Fax: (01524) 592072
> http://www.lancs.ac.uk/staff/cable/
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Re: enum !!

2001-07-16 Thread Tom Hodder


First normal form (1NF), A table in which the intersection of every column
and record contains one, and only one, value.



-Original Message-
From: Hugh Bothwell [mailto:[EMAIL PROTECTED]]
Sent: 16 July 2001 19:21
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: enum !!



"McShen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> how do i store multiple data in one field?
> i have a table like this
>
> +---+---+--+-+-+---+
> | Field | Type  | Null | Key | Default | Extra |
> +---+---+--+-+-+---+
> | test  | enum('a','b','c') | YES  | | NULL|   |
> +---+---+--+-+-+---+
>
> insert into test values('a','b','c');  doens't work. please help

Your query is mixed up; 'test' is the field name, not the table name, and I
think you want to put the values into three separate records, not one...

Try
INSERT INTO tablename ( test ) VALUES ( 'a' ), ( 'b'), ('c'), ('');

This should get you four records, with 'test' values of a, b, c, and null.

If you want to store more than one value in the same record, you should be
looking at sets, not enums.



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] NEXT - PREVIOUS coding

2001-07-16 Thread Tom Hodder

rough and readysomething like this should work...

$pagesize = 20;
$page = $page ? $page : 1;
$pages = ceil(mysql_num_rows( $results ) / $pagesize );
mysql_data_seek( $results, ($page - 1) * $pagesize );

while( ($row = mysql_fetch_object( $results )) && ( $counter++ <
$pagesize) )
{
//  print rows of data etc etc
}

if( ($page > 1) )
{
print "Next";
}

if( ($page < $pages) && ( $pages > 1 )  )
{
print "Next";
}






-Original Message-
From: Pranot Kokate [mailto:[EMAIL PROTECTED]]
Sent: 16 July 2001 09:40
To: [EMAIL PROTECTED]
Subject: [PHP-DB] NEXT - PREVIOUS coding


hi.. friends

i have a database (mysql) in which their r many records. Through PHP i want
them to display on the page.

Main requirement is that there should be a NEXT - PREVIOUS facility. So if
there r 20 records and suppose only 10 should show up on scren at a time,
then a NEXT link should be visible which could show the remaining 10
records.

Their can be n no. of records.

Pls help.

Kind Regards,
Pranot


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Need a shopping cart

2001-07-11 Thread Tom Peck

Matthew

So what's so funny about installing MySQL on a NT system that is already 
running Perl and PHP?  I think it makes perfect sense :-).

Tom

At 00:52 12/07/2001 -0400, you wrote:

>Everyone suggesting "Easy!  Just install Mysql!" makes me laugh... :)
>
>Jeff-- I suggest you check:
>
>1) http://www.hotscripts.com/
>2) http://www.zend.com/
>3) http://www.sourceforge.com/
>4) http://www.mysql.com/ (Just kidding!)
>
>Any shopping cart that uses ODBC should work just fine--  and moreso, it
>shouldn't be hard (if you absolutely needed to) to modify a Mysql cart
>to use odbc calls instead.
>
>Best of luck!
>
>
>"Jeff @ HookedOnThe.Net" wrote:
> >
> > Can anyone direct me to a shopping cart package (preferrably in PHP,
> > although PERL would possibly work) which utilizes either an MS Access
> > database or flat files?  I've found several shopping carts, but they
> > all seem to require MySQL which I do not have access to on my server.
> > My server is Windows NT 4 with PHP 4 and PERL 5.
> >
> > I sure hope someone can help.  Thanks in advance.
> >
> > Regards,
> > Jeff <[EMAIL PROTECTED]>  -  ICQ UIN:  736807
> > Training, Web Hosting and Design
> > http://www.HookedOnThe.Net
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> > [EMAIL PROTECTED]
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] pulling my hair out

2001-07-11 Thread Tom Peck

Stupid html e-mail...

That code may not come through properly...  copy it from the site, as 
what's below is only half complete.

Tom



At 16:23 12/07/2001 +1200, you wrote:
>Brad
>
>Try this:
>--
>$status = 0;
>if (isset($myTstCky) && ($myTstCky == "ChocChip")) $status = 1;
>if (!isset($CCHK)) {
>setcookie("myTstCky", "ChocChip");
>header("Location: $PHP_SELF?CCHK=1");
>exit;
>}
>?>
>Cookie Check Status: $status ? "PASSED!" : "FAILED!"); ?>
>---
>
>
>It's taken from here:  http://www.php.net/manual/en/function.setcookie.php
>
>If that still fails to work then your PHP config must be awry..
>
>Tom
>
>
>
>
>At 21:16 11/07/2001 -0700, you wrote:
> >I have one script that looks like this:
> >
> > >setcookie ("logged_in", "yes", time() - 3600);
> >setcookie ("logged_user_name", "brad", time() - 3600);
> >?>
> >
> >SENT
> >and another that looks like this:
> >
> > >print "start ";
> >echo $HTTP_COOKIE_VARS["logged_in"];
> >print "";
> >echo $logged_user_name;
> >print "";
> >print "end";
> >?>
> >
> >which I have also tried like this:
> >
> > >print "";
> >echo $logged_in;
> >print "";
> >echo $logged_user_name;
> >?>
> >
> >It seems like this should be extremely simple, but when I run the first one,
> >and then the second one, the second one only writes the 's to the
> >document.  It also doesnt trigger my browser (tried in netscape and ie5) to
> >alert me that a cookie is being sent, I turned that option on just to test
> >this script.
> >Please Help!
> >
> >
> >Brad
> >
> >
> >
> >--
> >PHP Database Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] pulling my hair out

2001-07-11 Thread Tom Peck

Brad

Try this:
--


Cookie Check

Cookie Check Status:
%s
;',
$status ? "00FF00" : "FF",
$status ? "PASSED!" : "FAILED!");
?>


---


It's taken from here:  http://www.php.net/manual/en/function.setcookie.php

If that still fails to work then your PHP config must be awry..

Tom




At 21:16 11/07/2001 -0700, you wrote:
>I have one script that looks like this:
>
>setcookie ("logged_in", "yes", time() - 3600);
>setcookie ("logged_user_name", "brad", time() - 3600);
>?>
>
>SENT
>and another that looks like this:
>
>print "start ";
>echo $HTTP_COOKIE_VARS["logged_in"];
>print "";
>echo $logged_user_name;
>print "";
>print "end";
>?>
>
>which I have also tried like this:
>
>print "";
>echo $logged_in;
>print "";
>echo $logged_user_name;
>?>
>
>It seems like this should be extremely simple, but when I run the first one,
>and then the second one, the second one only writes the 's to the
>document.  It also doesnt trigger my browser (tried in netscape and ie5) to
>alert me that a cookie is being sent, I turned that option on just to test
>this script.
>Please Help!
>
>
>Brad
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Need a shopping cart

2001-07-11 Thread Tom Peck

Jeff

Have you tried:  http://www.hotscripts.com  it seems to have a huge 
selection of PHP scripts - i'm not sure if it has what you are after 
though.  Why don't you have MySQL installed on your NT machine?  It is a 
LOT quicker than any MS Access database, or flat file - especially if you 
are setting up a shopping cart site.

Tom



At 18:46 11/07/2001 -0700, you wrote:
>Can anyone direct me to a shopping cart package (preferrably in PHP,
>although PERL would possibly work) which utilizes either an MS Access
>database or flat files?  I've found several shopping carts, but they
>all seem to require MySQL which I do not have access to on my server.
>My server is Windows NT 4 with PHP 4 and PERL 5.
>
>I sure hope someone can help.  Thanks in advance.
>
>Regards,
>Jeff <[EMAIL PROTECTED]>  -  ICQ UIN:  736807
>Training, Web Hosting and Design
>http://www.HookedOnThe.Net
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Oracle Client Libraries?

2001-07-11 Thread Tom Tsongas

Hi again.

I just found an above message that states the DLLs I need are in the PHP package
I installed and I just need to uncomment them from php.ini. Am I off the beaten
track or is that true?

I found the listings for php_oracle.dll and php_oci8.dll in php.ini under the
'Dynamic Extensions' section. I'm 'guessing' I only need to restart Apache now
to activate the extensions.

In my scenario, php and Apache are on my local NT server while the Oracle
database is on a Solaris box. Anything else I need to know?

Thanks in advance.

Tom


Anthony Carlos wrote:

> Tom:
>
> Go to technet.oracle.com and download Oracle 8i Database for WinNT. When you
> run the installer, you can do a custom set-up to only install the networking
> libraries (Net8). Run Net8 Easy Config. That will get you started.
>
> I'm not sure how much it costs officially. You'll have to call up Oracle for
> current pricing.
>
> Anthony Carlos
>
> -Original Message-
> From: Tom Tsongas [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 12:56 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Oracle Client Libraries?
>
> Hi all.
>
> Where can I get the Oracle client libraries for PHP4? I am running
> Apache and PHP4 on my NT Server and I will be connecting to an Oracle
> database on a Solaris server via remote connect? I saw some threads
> earlier indicating that they could be found at download.swwwing.com but
> that server is apparantly no longer running.
>
> Anyone?
>
> Thanks.
>
> Tom Tsongas
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Oracle Client Libraries?

2001-07-11 Thread Tom Tsongas

Hi all.

Where can I get the Oracle client libraries for PHP4? I am running
Apache and PHP4 on my NT Server and I will be connecting to an Oracle
database on a Solaris server via remote connect? I saw some threads
earlier indicating that they could be found at download.swwwing.com but
that server is apparantly no longer running.

Anyone?

Thanks.

Tom Tsongas



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Row order

2001-07-11 Thread Tom

Cookie or session?  A little extreme, but if you don't want it in the url 
then that's the only other way I can think of to remember a variable when 
the page is refreshed..

Tom



At 13:09 11/07/2001 +0200, you wrote:
>Hello!
>
>I have this little problem sorting a search result by different fieldnames.
>
>I do my search, get a quite impressive amount of variables that I use in 
>my MySQL-query, and by default use "ORDER BY name".
>
>But I want to be able to klick on different headers to sort like "ORDER BY 
>$order".
>
>The problem that I encounter is that I lose all the variables from the 
>search when I refresh the document. Is it possible to resend all variables 
>without inserting them in the -tag ?
>(like )
>
>Hopefully someone has a smart solution.. =)
>
>regards
>
>  - Stefan
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] cookie problems

2001-07-11 Thread Tom

The variables wont become available until the cookies are read - which 
happens when the script is first loaded.  Normally the cookies are set, 
then a header is sent to reload the page - but be carful not to create an 
endless loop of browser reloading...

Check out the examples on: 
http://www.php.net/manual/en/function.setcookie.php  if you still can't get 
it working, let us know...

Tom


At 23:40 10/07/2001 -0700, you wrote:
>HI,
>my guess is is that the cookies will be killed the NEXT time you run this
>script.
>
>Ken
>- Original Message -
>From: "Brad Lipovsky" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, July 10, 2001 11:24 PM
>Subject: [PHP-DB] cookie problems
>
>
> > can anyone help me with this code?  i cant believe it wont work, it seems
> > pretty simple!
> >
> >  > setcookie ("logged_in", "logged in", time() - 3600);
> > setcookie ("logged_user_name", "logged user name", time() - 3600);
> >
> > print "$logged_in ";
> > print "$logged_user_name";
> > ?>
> >
> > brad
> >
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] LOAD DATA LOCAL ERROR

2001-07-10 Thread Tom Peck

I may be not understanding properly without checking your MySQL syntax, but 
should it not be "C:\WINDOWS\Desktop\db.txt"?

Tom


At 08:53 10/07/2001 -0500, you wrote:
>Every time I use the command
>
>LOAD DATA LOCAL INFILE "C:WINDOWS:Desktop:db.txt" INTO TABLE booktest;
>
>I get this error message...
>
>ERROR:
>File 'C:WINDOWS:Desktop:db.txt' not found (Errcode: 2)
>
>
>How can I load my  file to the database???
>
>--Will


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] RE: trash last message ,this ones right I think

2001-07-10 Thread Tom Peck

Ken

If the util site is going to be part of the main site, why don't you put it 
in the www folder?  ie.  /htdocs/www/util/  the idea for different site 
roots is so that you can keep different sites separate.

If you had the root as /htdocs/  for all, then the website address would 
be:  http://www.yourdomain.com/www/index.php  or wat eva..  not very nice..

Tom



At 18:26 10/07/2001 -0700, you wrote:

>Thanks again,
>why couldn't the main root be /htdocs/
>?
>ken
>- Original Message -
>From: "Tom Peck" <[EMAIL PROTECTED]>
>To: "Ken Sommers" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
>Sent: Tuesday, July 10, 2001 6:05 PM
>Subject: Re: [PHP-DB] RE: trash last message ,this ones right I think
>
>
> > Yes that is correct.
> >
> > Your main site root is: /htdocs/www/
> > And your sub site (util) root is /htdocs/util/
> >
> > These are two different sites from the browser's point of view.
> >
> > Neither site will have access to anything below the root folder (from the
> > browser).
> >
> > Tom
> >
> > At 18:02 10/07/2001 -0700, you wrote:
> > >Thanks Tom
> > >  and sorry I didn't mention it properly at first,,
> > >I was trying to analyse the problem.
> > >is it becuz the first part of the referenece being the   ../
> > >in 
> > >the ../  wants to take the browser into illegal territory above the root?
> > >because we are starting from /htdocs/util  so the  ../  would try to go
>back
> > >to /htdocs
> > >
> > >which is above the root (/htdocs/www) illegal territory.
> > >just tryin to understand it
> > >
> > >thanks ,
> > >Ken
> > >
> > >- Original Message -
> > >From: "Tom Peck" <[EMAIL PROTECTED]>
> > >To: <[EMAIL PROTECTED]>
> > >Sent: Tuesday, July 10, 2001 5:50 PM
> > >Subject: Re: [PHP-DB] RE: trash last message ,this ones right I think
> > >
> > >
> > > > The problem is that they are completely different websites, from the
>web
> > > > browser point of view - even though they are so close to each other on
>the
> > > > server...  You should have mentioned this was a sub domain site :-)
> > > >
> > > > If you REALLY don't want to copy the image from the www folder to the
>util
> > > > folder, then you have to use:
> > > >
> > > > background="http://www.consumergrapevine.org/img/background.jpg";>
> > > >
> > > > So that the browser can reach the image file.
> > > >
> > > > Tom
> > > >
> > > >
> > > >
> > > > At 17:30 10/07/2001 -0700, you wrote:
> > > > >Hello again,
> > > > >  DOCUMENT_ROOT is..  /htdocs/www
> > > > >I  have a php file ( showdatabases.php) in my subdomain area
> > >/htdocs/util/
> > > > >it loads up just fine: and if you click it, you will see my database
> > > > >structure if you like..:)
> > > > >http://util.consumergrapevine.org/showdatabases.php
> > > > >I have images stored in  /hdocs/www/img/  right now  (of course i
>could
> > >move
> > > > >them, and fix all references to them) but I like them there because I
>can
> > > > >refer to images in pages in /www/ with background="img/bgpic.jpg"
> > >...of
> > > > >course this works just fine becuz /img/ is just down from /www/.
> > > > >but now I have pages in subdomains as menitoned above like:
> > > > >/htdocs/util/showdatabases.php
> > > > >and of course I want to refer to images from those subdomain pages
> > >too,,and
> > > > >of course
> > > > >I don't want to have another dir with the same pics in
>them..something
> > > > >like...  /htdocs/util/img/
> > > > >becuz I already have the pics in /htdocs/www/img/  and if I make
>another
> > >sub
> > > > >domain called /htdocs/stuff , I don't want to have to copy the pics
>AGAIN
> > > > >into /htdocs/stuff/img
> > > > >right? So,,, (yes I may be getting to the end now..) how or where
>should
> > >I
> > > > >put my pics so the /www/ and /util/ and /stuff/ guys can use them as
> > > > >background pics?
> > > > >
> > > > >what would the body tag look like?
> > > > >   doesn;t work
> > > > >what will?
> > > > >
> > > > >thanks again,
> > > > >
> > > > >Ken
> > > > >
> > > > >
> > > > >
> > > > >--
> > > > >PHP Database Mailing List (http://www.php.net/)
> > > > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > >For additional commands, e-mail: [EMAIL PROTECTED]
> > > > >To contact the list administrators, e-mail:
>[EMAIL PROTECTED]
> > > >
> > > >
> > > > --
> > > > PHP Database Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
>[EMAIL PROTECTED]
> > > >
> > > >
> >
> >
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: trash last message ,this ones right I think

2001-07-10 Thread Tom Henry


Perhaps you could consider using the webserver config (in Apache it 
would be the httpd.conf file) to do the dirty work.

Create and alias (in the /util/ domain) for "img"  that points to the 
"/hdocs/www/img/" location - voila!  YMMV

HTH
Tom Henry



Ken Sommers wrote:

> Hello again,
>  DOCUMENT_ROOT is..  /htdocs/www
> I  have a php file ( showdatabases.php) in my subdomain area   /htdocs/util/
> it loads up just fine: and if you click it, you will see my database
> structure if you like..:)
> http://util.consumergrapevine.org/showdatabases.php
> I have images stored in  /hdocs/www/img/  right now  (of course i could move
> them, and fix all references to them) but I like them there because I can
> refer to images in pages in /www/ with background="img/bgpic.jpg"...of
> course this works just fine becuz /img/ is just down from /www/.
> but now I have pages in subdomains as menitoned above like:
> /htdocs/util/showdatabases.php
> and of course I want to refer to images from those subdomain pages too,,and
> of course
> I don't want to have another dir with the same pics in them..something
> like...  /htdocs/util/img/
> becuz I already have the pics in /htdocs/www/img/  and if I make another sub
> domain called /htdocs/stuff , I don't want to have to copy the pics AGAIN
> into /htdocs/stuff/img
> right? So,,, (yes I may be getting to the end now..) how or where should I
> put my pics so the /www/ and /util/ and /stuff/ guys can use them as
> background pics?
> 
> what would the body tag look like?
>doesn;t work
> what will?
> 
> thanks again,
> 
> Ken
> 
> 
> 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] RE: trash last message ,this ones right I think

2001-07-10 Thread Tom Peck

Yes that is correct.

Your main site root is: /htdocs/www/
And your sub site (util) root is /htdocs/util/

These are two different sites from the browser's point of view.

Neither site will have access to anything below the root folder (from the 
browser).

Tom

At 18:02 10/07/2001 -0700, you wrote:
>Thanks Tom
>  and sorry I didn't mention it properly at first,,
>I was trying to analyse the problem.
>is it becuz the first part of the referenece being the   ../
>in 
>the ../  wants to take the browser into illegal territory above the root?
>because we are starting from /htdocs/util  so the  ../  would try to go back
>to /htdocs
>
>which is above the root (/htdocs/www) illegal territory.
>just tryin to understand it
>
>thanks ,
>Ken
>
>- Original Message -
>From: "Tom Peck" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, July 10, 2001 5:50 PM
>Subject: Re: [PHP-DB] RE: trash last message ,this ones right I think
>
>
> > The problem is that they are completely different websites, from the web
> > browser point of view - even though they are so close to each other on the
> > server...  You should have mentioned this was a sub domain site :-)
> >
> > If you REALLY don't want to copy the image from the www folder to the util
> > folder, then you have to use:
> >
> > http://www.consumergrapevine.org/img/background.jpg";>
> >
> > So that the browser can reach the image file.
> >
> > Tom
> >
> >
> >
> > At 17:30 10/07/2001 -0700, you wrote:
> > >Hello again,
> > >  DOCUMENT_ROOT is..  /htdocs/www
> > >I  have a php file ( showdatabases.php) in my subdomain area
>/htdocs/util/
> > >it loads up just fine: and if you click it, you will see my database
> > >structure if you like..:)
> > >http://util.consumergrapevine.org/showdatabases.php
> > >I have images stored in  /hdocs/www/img/  right now  (of course i could
>move
> > >them, and fix all references to them) but I like them there because I can
> > >refer to images in pages in /www/ with background="img/bgpic.jpg"
>...of
> > >course this works just fine becuz /img/ is just down from /www/.
> > >but now I have pages in subdomains as menitoned above like:
> > >/htdocs/util/showdatabases.php
> > >and of course I want to refer to images from those subdomain pages
>too,,and
> > >of course
> > >I don't want to have another dir with the same pics in them..something
> > >like...  /htdocs/util/img/
> > >becuz I already have the pics in /htdocs/www/img/  and if I make another
>sub
> > >domain called /htdocs/stuff , I don't want to have to copy the pics AGAIN
> > >into /htdocs/stuff/img
> > >right? So,,, (yes I may be getting to the end now..) how or where should
>I
> > >put my pics so the /www/ and /util/ and /stuff/ guys can use them as
> > >background pics?
> > >
> > >what would the body tag look like?
> > >   doesn;t work
> > >what will?
> > >
> > >thanks again,
> > >
> > >Ken
> > >
> > >
> > >
> > >--
> > >PHP Database Mailing List (http://www.php.net/)
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] RE: trash last message ,this ones right I think

2001-07-10 Thread Tom Peck

The problem is that they are completely different websites, from the web 
browser point of view - even though they are so close to each other on the 
server...  You should have mentioned this was a sub domain site :-)

If you REALLY don't want to copy the image from the www folder to the util 
folder, then you have to use:

http://www.consumergrapevine.org/img/background.jpg";>

So that the browser can reach the image file.

Tom



At 17:30 10/07/2001 -0700, you wrote:
>Hello again,
>  DOCUMENT_ROOT is..  /htdocs/www
>I  have a php file ( showdatabases.php) in my subdomain area   /htdocs/util/
>it loads up just fine: and if you click it, you will see my database
>structure if you like..:)
>http://util.consumergrapevine.org/showdatabases.php
>I have images stored in  /hdocs/www/img/  right now  (of course i could move
>them, and fix all references to them) but I like them there because I can
>refer to images in pages in /www/ with background="img/bgpic.jpg"...of
>course this works just fine becuz /img/ is just down from /www/.
>but now I have pages in subdomains as menitoned above like:
>/htdocs/util/showdatabases.php
>and of course I want to refer to images from those subdomain pages too,,and
>of course
>I don't want to have another dir with the same pics in them..something
>like...  /htdocs/util/img/
>becuz I already have the pics in /htdocs/www/img/  and if I make another sub
>domain called /htdocs/stuff , I don't want to have to copy the pics AGAIN
>into /htdocs/stuff/img
>right? So,,, (yes I may be getting to the end now..) how or where should I
>put my pics so the /www/ and /util/ and /stuff/ guys can use them as
>background pics?
>
>what would the body tag look like?
>   doesn;t work
>what will?
>
>thanks again,
>
>Ken
>
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: MySQL Database Locking - needed?

2001-07-10 Thread Tom Peck

Ahhh, ok a good idea.  I will think about it some more.

Thanks

Tom

At 16:55 10/07/2001 -0700, you wrote:
>Tom Peck wrote:
> > >
> > >How about writing a text file that would be your "lock" file, rather
> > >than depending upon MySQL to do it for you?
> > >
> > >--
> > >Raquel
> >
> > So what you mean is:
> >
> > If someone clicks on a car to edit, a txt file is written (maybe called the
> > carID.txt).  Then if someone else clicks on that car to edit it, it says
> > that it is already being edited by someone else because the txt file
> > exists?  So what happens if that person who clicked first closes his
> > browser before updating the car?  How can that text file be automatically
> > erased?
> >
> > I think I'll just assume that this wont be a problem, and if someone
> > overwrites someone elses edit then too bad.. :-)
> >
> > Tom
>
>Why not check the date/time the file was created?  If an arbitrary
>amount of time has expired (2 minutes?  5 minutes?) then you create your
>own lock file as if the first wasn't there?
>
>--
>Raquel
>
>He who has imagination without learning has wings and no feet.
>   --Anonymous


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] HTML question

2001-07-10 Thread Tom Peck

The php file placed in your /util/ directory will not be accessible by the 
web..  everything you want accessible to the web has to be placed in the 
/www/  folder..  so place the php file in the /www/ folder (or /www/util/ 
if you like) and the images in the /www/img/ folder, and use the body tag:

  (for /www/)
or
  (for /www/ and /www/util/)
or
  (for /www/util/)

Tom



At 16:38 10/07/2001 -0700, you wrote:
>I Looked up the root..sorry
>  it is DOCUMENT_ROOT ..  /htdocs/www
>so I guess browsers think they are starting out at /htdocs/www  and can't go
>below to get anything?
>so if I have phtml pages at /htdocs/util/ like
>www.util.consumergrapevine.org/showdatabases.php and images at
>/htdocs/www/img can I use an image in /htdocs/www/img  as sa background imge
>in a page located in dir  /htdocs/util/  ??
>if so,what would be the body tag look like?
>   ?
>or should I move my /img/ dir somewhere else like maybe throw 'em in with
>all the pages in /htdocs/www
>?
>
>thanks again,
>
>Ken
>
>- Original Message -
>From: "Tom Peck" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, July 10, 2001 4:00 PM
>Subject: Re: [PHP-DB] HTML question
>
>
> > Is /htdocs/  your web root?  If it isn't the browser loading up the page
> > would not have access to /www/img/backgroundimage.jpg.  If it is - try
> > removing the space after the .jpg in your body tag look like?
> >
> >
> > Tom
> >
> >
> > At 15:51 10/07/2001 -0700, you wrote:
> > >Hello, pure HTML server question:
> > >
> > >images like (backgroundimage.jpg) stored on server at: /htdocs/www/img
> > >
> > >util.showpic.html is stored at :   /htdocs/util/
> > >
> > >How to use backgroundimage.jpg as background in util.showpic.html  ?
> > >
> > >
> > >
> > >
> > >does not work..
> > >what if anything will work?
> > >
> > >Thnaks
> > >Ken
> > >
> > >
> > >--
> > >PHP Database Mailing List (http://www.php.net/)
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: MySQL Database Locking - needed?

2001-07-10 Thread Tom Peck

So what you mean is:

If someone clicks on a car to edit, a txt file is written (maybe called the 
carID.txt).  Then if someone else clicks on that car to edit it, it says 
that it is already being edited by someone else because the txt file 
exists?  So what happens if that person who clicked first closes his 
browser before updating the car?  How can that text file be automatically 
erased?

I think I'll just assume that this wont be a problem, and if someone 
overwrites someone elses edit then too bad.. :-)

Tom


At 16:30 10/07/2001 -0700, you wrote:
>Tom Peck wrote:
> >
> > Thanks for the reply Manual.
> >
> > The updating IS done with one single query - but the problem is that if two
> > people are editing the same car, the second update will overwrite the
> > first.  Not a huge problem - and the chance of it happening is almost nil -
> > but there is still the possibility..  Changing databases seems a little
> > extreme - and not possible with our web host.
> >
> > Tom
>
>How about writing a text file that would be your "lock" file, rather
>than depending upon MySQL to do it for you?
>
>--
>Raquel
>
>He who has imagination without learning has wings and no feet.
>   --Anonymous


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] HTML question

2001-07-10 Thread Tom Peck

when you load up your web page in your browser, what folder do you see?  It 
is most likely the contents of the www/ folder.

If this is the case, then all of your files which you want accessible to 
the web (ie html and images) need to be somewhere under this.  Try putting 
both the background image and the html file in the www folder, then change 
your body tag to: then load up 
the page.

If that works fine, and you want the images in a different folder, create a 
dir (eg. img ) coming off the www/  folder, then put the background image 
in there, and change your body tag to:


or


If your html file was in the img/ directory, and the image was in the www/ 
folder, so it looks like this:

/www/img/file.html
/www/backgroundimage.jpg

then your body tag could be:



the "../" just traverses down a directory.

If none of this makes sense to you, you should probably do some basic html 
tutorials or something :-)


Tom





At 16:19 10/07/2001 -0700, you wrote:
>HI, thanks
>not sure what the web root is.
>first dir I see on FTP is  /  so is that the root?
>and it contains a whole bunch of dirs including htdocs
>htdocs contains dirs:  img (pics)   util (utility html pages)   www (main
>html pages)
>
>is there a way to refer to images in imgfrom html pages in  util AND www
>
>I have things like  ../img/   not sure what that means.
>
>thanks,
>ken
>
>
>
>
>
>
>
>- Original Message -
>From: "Tom Peck" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Tuesday, July 10, 2001 4:00 PM
>Subject: Re: [PHP-DB] HTML question
>
>
> > Is /htdocs/  your web root?  If it isn't the browser loading up the page
> > would not have access to /www/img/backgroundimage.jpg.  If it is - try
> > removing the space after the .jpg in your body tag.
> >
> > Tom
> >
> >
> > At 15:51 10/07/2001 -0700, you wrote:
> > >Hello, pure HTML server question:
> > >
> > >images like (backgroundimage.jpg) stored on server at: /htdocs/www/img
> > >
> > >util.showpic.html is stored at :   /htdocs/util/
> > >
> > >How to use backgroundimage.jpg as background in util.showpic.html  ?
> > >
> > >
> > >
> > >
> > >does not work..
> > >what if anything will work?
> > >
> > >Thnaks
> > >Ken
> > >
> > >
> > >--
> > >PHP Database Mailing List (http://www.php.net/)
> > >To unsubscribe, e-mail: [EMAIL PROTECTED]
> > >For additional commands, e-mail: [EMAIL PROTECTED]
> > >To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: MySQL Database Locking - needed?

2001-07-10 Thread Tom Peck

Thanks for the reply Manual.

The updating IS done with one single query - but the problem is that if two 
people are editing the same car, the second update will overwrite the 
first.  Not a huge problem - and the chance of it happening is almost nil - 
but there is still the possibility..  Changing databases seems a little 
extreme - and not possible with our web host.

Tom



At 20:03 10/07/2001 -0300, you wrote:
>Hello,
>
>Tom Peck wrote:
> >
> > Hi
> >
> > The company I work for has recently developed a Car Dealer type site, which
> > acts as a large on-line used car yard.  Currently the MySQL database
> > holding the cars is added too / edited / deleted by one person employed for
> > the job - but we hope to expand to allow the Dealers themselves admin
> > rights to their on-line cars.
> >
> > I have begun development of a Dealer Admin area - but have a couple of
> > questions regarding this:
> >
> > 1)  Would any sort of Table Locking be needed for this -  for example if
> > two people were trying to update the same car, at the same time etc etc..
>
>No, if updating is done with a single query.
>
>
> > 2)  If yes, is there any on-line documentation on this?
> > 3)  What other problems could arise if this was implemented?
>
>It depends on what you really want to do.
>
>Anyway, MySQL has LOCK TABLES but I don't recommend to use them without
>proper because you inadvertdly may leave the database locked. The latest
>versions also support transactions. It's a bit awkward but it works,
>although the recommendation is the same.
>
>Maybe you want to try other databases that handle transactions more
>efficiently like Oracle, or PostgreSQL if you can't afford a commercial
>database.
>
>If you are not sure about switching to other databases, you may want to
>try Metabase which is a database abstraction package that lets you write
>portable database applications. That way, you may switch (or not) to
>another database later without changing your application code.
>
>Metabase is free and is available here:
>
>http://phpclasses.UpperDesign.com/browse.html/package/20
>
>Manuel Lemos
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] HTML question

2001-07-10 Thread Tom Peck

Is /htdocs/  your web root?  If it isn't the browser loading up the page 
would not have access to /www/img/backgroundimage.jpg.  If it is - try 
removing the space after the .jpg in your body tag.

Tom


At 15:51 10/07/2001 -0700, you wrote:
>Hello, pure HTML server question:
>
>images like (backgroundimage.jpg) stored on server at: /htdocs/www/img
>
>util.showpic.html is stored at :   /htdocs/util/
>
>How to use backgroundimage.jpg as background in util.showpic.html  ?
>
>
>
>
>does not work..
>what if anything will work?
>
>Thnaks
>Ken
>
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] MySQL Database Locking - needed?

2001-07-10 Thread Tom Peck

Hi

The company I work for has recently developed a Car Dealer type site, which 
acts as a large on-line used car yard.  Currently the MySQL database 
holding the cars is added too / edited / deleted by one person employed for 
the job - but we hope to expand to allow the Dealers themselves admin 
rights to their on-line cars.

I have begun development of a Dealer Admin area - but have a couple of 
questions regarding this:

1)  Would any sort of Table Locking be needed for this -  for example if 
two people were trying to update the same car, at the same time etc etc..
2)  If yes, is there any on-line documentation on this?
3)  What other problems could arise if this was implemented?

Thanks all

Tom Peck


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] Submiting forms to mySQL

2001-07-09 Thread Tom Hodder


You can use the TARGET attribute of the form that would be in the
edit,delete,submit frame to make the main page process the form variables.

ie clicking on submit in the edit frame would send the vales
var1=ffefe&var2=gfregr, etc etc, to the main frame.

alternatively you could use the javascript onSubmit events to manage which
form gets what.

Regards

Tom


-Original Message-
From: James Wharton [mailto:[EMAIL PROTECTED]]
Sent: 09 July 2001 20:36
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Submiting forms to mySQL


I would like to have a three frame webpage. The data entry would be in the
main frame while the "edit" "delete" and "submit" buttons would be in
another frame. Is this possible? I thought that you could only submit things
between the  tags. (not things in different html or php files)



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Which state and country?

2001-07-02 Thread Tom Carter

This can give a fair idea of where that person has come from, and if they
are international then the country may be obvious. I would be very surprised
if you could collect meaningul information about which state they are tho.
In my experience, however, lots of hosts turn off reverse DNS lookups
last count in my stats was 40%. That said, there are pretty much no other
(simple) ways of doing this


> Turn on referrers in the Apache config file and do reverse DNS lookuips in
> your web analyser.
>
> -Original Message-
> From: Lisa Elita [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 28, 2001 9:21 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Which state and country?
>
>
> Hi all,
>
> How can we know from which state and country a hit came?
>
> Regards,
> Lisa Elita
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] perl fork() in PHP?

2001-06-27 Thread Tom Hodder




Can I do something similar to the perl fork() in php and if so, does anyone
know of any examples of this.

regards

Tom Hodder



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP-DB] Compile MySQL 3.23.39 problem after installing PHP 4.06

2001-06-24 Thread Tom Cheung

Hi:
After I have successfully installed PHP 4.06 then I want to upgrade my
MySQL 3.23.37 to 3.23.39 using source method.

After downloading and tar,
Then I type "./configure --prefix=/usr/local/mysql"

During make process.Error occurs.Here's some warning message:
In file included from /usr/include/linux/rhconfig.h:13,
 from /usr/include/linux/autoconf.h:1,
 from /usr/include/linux/config.h:4,
 from /usr/include/asm/atomic.h:4,
 from ../include/global.h:203,
 from bfill.c:15:
/boot/kernel.h:2:10: warning: extra tokens at end of #ifndef directive
/boot/kernel.h:12:10: warning: ISO C requires whitespace after the macro
name
/boot/kernel.h:19:10: warning: extra tokens at end of #ifndef directive

This message has repeatedly appear for more times during make.Finally make
progress interrupt.

So would anyone know what's the problem and how to solve it ?Is it related
to mysql support during configure PHP installing
(--with-mysql=/usr/local/mysql)

Or we must install mysql and then PHP (There's a ordering of installing ?
MySQL then PHP)
Thx




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] imap problem

2001-06-20 Thread Tom Hodder

Hi,


It's likely that you need to enable imap support,
if you are using win32 this is relatively simple, all you have to do is get
the dll from the php website and uncomment the lines from the extensions
section of the php.ini file. If you are using unix, then you have to
recompile php with the --imap flag (I think, something like that) although I
had no end of trouble getting this to work,

Regards

Tom Hodder




-Original Message-
From: vipin chandran [mailto:[EMAIL PROTECTED]]
Sent: 20 June 2001 18:54
To: [EMAIL PROTECTED]
Subject: [PHP-DB] imap problem



Hi,
I am developing an email reader for IMAP/POP3. But I am getting the
following error when trying to excute the file. I have removed the
comment from the IMAP extensions in the php.ini.

Fatal error: Call to undefined function: imap_open() in conn.inc on
line 6

Contents of conn.inc is as below :



Please help.
Thanx in advance.
vipin chandran
[EMAIL PROTECTED]



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP-DB] php notepad

2001-05-18 Thread Tom Hodder \(Global Gold Network Ltd\)

UltraEdit

www.ultraedit.com


cool software




-Original Message-
From: Sharmad Naik [mailto:[EMAIL PROTECTED]]
Sent: 18 May 2001 12:47
To: [EMAIL PROTECTED]
Subject: [PHP-DB] php notepad


Hi,
I have recently fineshed my project in php
I want to document it.
Can anyone tell me an editor that highlights the code of PHP ?
and another question off the way is can i get drivers anywhere for an
Epson stylus Color 480 printer
-Regards
--
The secret of the universe is @*&í!'ñ^#+ NO CARRIER
___  _  _  _
|_|_||_||_||\/||_|| \
_|| || || \|  || ||_/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] displaying multiple results only one time...

2001-05-17 Thread Tom Busha

Ok, I've fifured a few possible solutions that seem really 
inefficient, but I'm wondering if anyone else has a better idea...

running php/mysql

while displaying product in a store site you click on a category, 
this brings up a page of manufacturers of stuff in the category as 
well as a link to all of the items by every manufacturer in that 
category.

if i select a manufacturer i am supposed to display all items in the 
selected category first, then all items not in that category below.

i tried using two queries

SELECT DISTINCT p.Name, p.Prod_ID
FROM Product p, Product_Category pc
WHERE p.In_Stock = 1 AND p.Prod_ID = pc.Prod_ID
AND pc.Cat_ID = '$Cat_ID' AND p.Man_ID = '$Man_ID'

then display results in the selected category

SELECT DISTINCT p.Name, p.Prod_ID
FROM Product p, Product_Category pc
WHERE p.In_Stock = 1 AND p.Prod_ID = pc.Prod_ID
AND pc.Cat_ID != '$Cat_ID' AND p.Man_ID = '$Man_ID'

display rest of the manufacturer's products *not* in the selected category...

the problem then comes when a product is in more than one category 
(which is why there is a "Product_Category" table in the first place:)

it still shows up in the bottom query (sure, it is not equal to the 
selected category, but it *is* equal to another category)

my two solutions -

3 queries, first query creates a temp table from the result of the 
first query above, 2nd query to pull info from the temp table and 
display it, 3rd query to do the second query from above, but instead 
of "pc.Cat_ID != '$Cat_ID'", compare
p.Prod_ID != temp.Prod_ID.


the second solution would be similar, but using arrays. run the first 
query from above and as it is displayed, build an array of Prod_IDs 
used. then run the second query and put a condition in that only 
displays if the returned Prod_ID is not an element of the array.


which of these solutions would be more efficient? and are there any 
more elegant/more efficient ways of doing this?

thanks in advance,

-- 
   __  Tom B 
  / /\  /\  _\
 / /  \  http://www.stypica.org \ \ \__  /
/ / /\ \ \ \ \  / / /
   / / /\ \ \  "It's ok honey, Just go in \ \ \/ / /
  / /_/__\ \ \   my bathroom and find  \ \/ / /
/\ \ \  something sticky" - Suriel \  / /
\___\/  \/_/
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] php/mySQL and html

2001-05-06 Thread Tom Carter

Hi Nick,

Assuming you have the rest of the databse interaction, all you need to is
store the value of the selection (the store script will recieve a varialbe
$state="AK" or whatever.

To then display the users state do the following
//Get the users state from the database
//do this however appropiate in your code
$users_state = "AK"; //(for the sake of argument)

//create array of states (better way of making the form
$states = array("AK","AR",);

$numstates=count($states);
echo(" $currstate");//finish the tag
}
echo("");

Hope this helps!
Tom




 On Sun, 6 May 2001, Nick
Terzich wrote:

> hi...
>
> I have a user registration system that I need to add a
> "state" field to. Part of the form will look something
> like this but with all 50 states instead of just two:
>
> 
> 
> AK
> AL
> 
> 
>
> ...how do I insert the user's state into the database
> and then how do I show the user's state as the
> "selected" state in the drop down list later when the
> user comes back to update his/her profile?
>
> hope this makes sense.. thanks,
>
> nick
>
>
> __
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] email and groupware integration

2001-02-11 Thread Tom

How to integrate email and groupware?
is there any scripts to grep email and output to forms
or databases.

Thx for your help



__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Migrating MySQL Table Data

2001-02-04 Thread Tom Carter

The CREATE TABLE .. FROM ... SQL will do what you require, but I don't
think this is included in MySQL (one to check)...however if performance is
becoming an issue, ,then you may want to consider migrating to a different
DBMS (mySQL is not so good at handling large record sets, and has a much
cut-down set of SQL sytanx).

Sticking with mysql however, if it was a once off move that needed to take
place (which is what it sounds like) then it wouldn't be hard to write a
simple agent .. somethi like

1. select all records in the original table 
2. Loop through all the records (rows)
  2.1. extract the fields from the currently selected row
  2.2. INSERT this into your new table
  2.3 go onto the next row
3. Once all are done, drop the unwanted columns from your old table

Inelegant ,yes, but it will work! If you want more help, contact me OL

Tom

On Sun, 4 Feb 2001, phobo wrote:

> I am in the process of improving a database scheme considerably in MySQL, by
> breaking tables into smaller tables and so one. I am wondering if there is a
> simple SQL statement to take ALL ROWS of fields 'f1', 'f2', 'f3', and copy
> them to the another table Then I can remove the fields in the original
> table.
> 
> eg something like
> INSERT INTO BetterSmallerTable SET (PrimKey,Red,Green,Blue) VALUES (SELECT
> PrimKey,Red,Green,Blue FROM BigClumsyTable) ??
> 
> Thanks,
> Siggy
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] insert into mysql

2001-01-29 Thread Tom Carter



On Thu, 25 Jan 2001, Darryl Friesen wrote:

> 
> 
> > It still didn't work.
> > just says unable to add part
> 
> > > $sql = "INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp')";
> 
> Another thought:  Are ID and part character data of some sort?  If not (i.e.
> if ID is an int) then remove the single quotes.
> 
A trivial point this, but if you insert values in ' into a mysql int
column then MySQl still treats it as intended. THey aren' necessary for
int columns, but it is acceptable to have them there

-Tom > 
> - Darryl
> 
>  --
>   Darryl Friesen, B.Sc., Programmer/Analyst[EMAIL PROTECTED]
>   Education & Research Technology Services, http://gollum.usask.ca/
>   Department of Computing Services,
>   University of Saskatchewan
>  --
>   "Go not to the Elves for counsel, for they will say both no and yes"
> 
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] pop up windows

2001-01-26 Thread Tom Carter

Hi John,

The essential difference between PHP and JavaScript is that PHP is
server-side and JavaScript client side. What this means is that when a
user requests a PHP page, all the functions, commands etc are run on the
server and then sent to the users machine, where as with JS the code is
effectively downloaded to the users machine and then run there.

In practice this means that anything which involves manipulating the users
computer (as opposed to just displaying output, which is what PHP does)
can only be done in JavaScript. Hence pop-up windows, which are
mainuplations of the users machine, are impossible in PHP alone.

However, what is possible, and I've found very powerful, is to use PHP to
create dynamic JS.

Essentially you use PHP to make JS in the same way it makes html

eg.


alert('<?echo($user);?>');


What would happen here is that the php parser on the server would run
first, and replace the echo statement with the value of $users, and then
return the javascript for the users machine to process, ie the user in
this case would recieve the following (assuming $user="bjorn"):


alert('bjorn');


Hope this helps,

Tom

On Fri, 26 Jan 2001, John Miller wrote:

> I know that this is off the subject, but I am hoping that some would be 
> kind enough to tell me what I would like to know.  In java script there is 
> an alert "command" that will cause a message box to popup.  Is there a way 
> to do it in php.  Better information would be to tell me where I could find 
> it in the documentation.
> 
> Thanks,
> John Miller
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Damn Cookie

2001-01-26 Thread Tom Carter

what is probably happening is that your file, page.html is setting the
variable user_name to a value at some point in the script. The URL you
gave effectively is the same as making the first two lines of the file
read
$user_name='name';
$password='password';

Hence if a subsquent line in the script then sents $user_name to a
different value then this will replace 'name'. TGhis would happen, for
example if you read from a cookie to find out the name.

One simple way around this is...

if(!$user_name)
{
//code to execute if $user_name hasn't alread got a value
}


On Thu, 25 Jan 2001, John Starkey wrote:

> I'm not sure if this is my problem but it's wigging me out.
> 
> I've got a login page posting only the user_name and password vars. No
> matter what it's using the same name over again.
> 
> http://.../page.html?user_name=name&password=password
> 
> When i open page.html and do echo $user_name it still doesn't echo the
> name above. Nothing is happening before the echo. 
> 
> I just checked with mac and it logged in the first time showing the user
> that I entered and is in the url. But when I went back and logged in under
> a diff name it retained the original name. 
> 
> Anyone know what's going on?
> 
> Thanks,
> 
> John
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




  1   2   >