[PHP-DB] Re: some php and database questions!

2003-03-12 Thread Joel Colombo
i think i gotcha... u really have a whole site design u need here huh.

do u know PHP / MYSQL ?

TABLE :
 games
FIELDS:
game_id as PRIMARY INDEX
game_title VC(100)
team_1 int (tie to key from teams table)
team_2 int (tie to key from teams table)
team_1_points (where u store a 1 for win/draw or a 0 for loss)
team_2_points (same as tema_1_points)
deadline int (UNIX timestamp for last possible second to submit)
status ENUM (some status' for your own use... like OPEN, CLOSED,
ETC)
ANY THING ELSE U WANT FOR GAMES. EX... last_modified, time_game_on,
... blah blah

TABLE:
teams
FIELDS:
team_id PRIMARY INDEX
team_name VC(100)
OTHER FIELDS

TABLE:
tipsters
FIELDS:
tipster_id PRIMARY KEY
name VC(100) their name or whatever
points int ... total points that tipster has.
OTHER FIELDS

TABLE:
placed_tips
FIELDS:
tip_id PRIMARY KEY
game_idties to the games table
team_tippedENUM (team_1, team_2) for matching to the proper
game fields.
time_placed maybe a timestamp to know when they placed the
tip
status  ENUM(OPEN, CLOSED) etc...


Basic Example
Tipster signs up and they get an entry in 'Tipsters'
Admin creates all the teams add them to 'teams'
Admin creates games add them to the 'games' table
Tipsters login and get to 'tip' games that are status'OPEN' from the
games table and deadline hasnt passed
Your cleanup script processes maybe on 'KRON' to update all games
'CLOSED' and score out the points from the 'placed_tips' table... adding
them to the right 'tipsters' total points.

we could even break the tables a little more if u wanted say points
scored somewhere else... like a teams and points cross table that can give u
the number of points a 'tipster' has scored total from each individual team
they have 'tipped' in the past there are all kinds of possiblities.

That should be it for the DB structure.
if you are interested in my basic design there. drop me a private Email for
some more.
if not good luck, sounds like a cool project.

Joel Colombo [EMAIL PROTECTED]
   Webdevil Studios
Buffalo, NY









Jerry [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I am currently running a tipping competition where
 people tip the team they think will win the given game
 or pick the draw.  Each correct entry gets +1 point,
 each incorrect entry gets 0 points.  There is 8 games
 a round and people submit their entries via a PHP page
 that updates a mysql database.  Now for the admin side
 of things, to make it easier for admins to update
 records accordingly without needing to manually add
 them up one by one.

 I want a system I can go into where I select the
 winners of each round.  If a tipster has any matches
 it will credit their accounts +1 for each correct
 entry and 0 for each incorrect entry.  There is 8
 games a round (on a weekend)  .. So how would I get
 the entries to update to the correct amount when I
 select the winners.

 I'd need the admin page to be something like this.

 Game1 : team 1
 team 2
 draw

 Game2 : team 3
 team 4
 draw

 and so on, Probably a drop down menu to select the
 winner or draw.  So what query would I need or PHP
 code to update the database with +1 for correct
 matches and 0 for incorrect?  Or would I be better to
 have 1 page per game?  I need a safe and reliable way
 of doing it.

 Also I am going to have a tipster tally.  They will be
 in order of total score.  So order will change from
 week to week, how can I auto-sort a list using PHP to
 display on a page without it messing up the score with
 someone else.  So I need the top score to go to the
 top but take the name also and not just the score, any
 ideas?

 For instance:

 Week 1

 bob 7
 judy 6
 Amanda 5
 

 Week 2

 Judy 10
 Amanda 9
 bob 8

 From week 1 to 2 bob needs to drop down the bottom,
 Judy needs to move up one and Amanda is to also move
 up one.  I need it to be automatic instead of me
 having to do it manually.  Any ideas?  (I think this
 was discussed about a month ago, if so I appologise
 for the repeat but the help is very appreciated.)

 Lastly the games in the week are different from
 others.  There is normally a Friday night games, a few
 Saturday games and Saturday Night and a few Sunday
 games.  I really don't want to lock people out if they
 don't submit a tip before the first game.  But I do
 want to lock out any tips made for a game that has
 already started.

 For instance:

 It's 8:05 PM and there was a game to start at 7PM I
 want to lock out the tips for the first game but allow
 tips for the remaining games.  How can I lock people
 out?  Sure I could remove the option on the page but
 that does not stop people from loading the page just
 before the start of the game and sitting on it 

[PHP-DB] Don't Understand

2003-03-12 Thread Dallas Freeman
Help!
 
I don't understand how to use the gdImageCopyResized
 
gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
int srcX, int srcY, int destW, int destH, int srcW, int srcH)
 
Thanking You
 
 
Dallas Freeman
 
* is there a simpler way to change the size of an image?


RE: [PHP-DB] Don't Understand

2003-03-12 Thread Snijders, Mark
no there is no other way, and it is pritty easy if you get it..

i've made a special function for it, but got the code @ home

but read this:

http://www.php.net/manual/nl/function.imagecopyresized.php

and especially the user comments.. they are always very usefull

goodluck



-Original Message-
From: Dallas Freeman [mailto:[EMAIL PROTECTED]
Sent: woensdag 12 maart 2003 12:05
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Don't Understand


Help!
 
I don't understand how to use the gdImageCopyResized
 
gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
int srcX, int srcY, int destW, int destH, int srcW, int srcH)
 
Thanking You
 
 
Dallas Freeman
 
* is there a simpler way to change the size of an image?


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



RE: [PHP-DB] Don't Understand

2003-03-12 Thread Dallas Freeman

Dear Mark, 

Thanks, very useful!  Can you direct me where for help on getting an
image to resize before it is even uploaded (inother words, it will
resize itself on the end-user's machine and then upload to the
database).

Thanking You,

Dallas Freeman












-Original Message-
From: Snijders, Mark [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 12 March 2003 9:09 PM
To: 'Dallas Freeman'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Don't Understand

no there is no other way, and it is pritty easy if you get it..

i've made a special function for it, but got the code @ home

but read this:

http://www.php.net/manual/nl/function.imagecopyresized.php

and especially the user comments.. they are always very usefull

goodluck



-Original Message-
From: Dallas Freeman [mailto:[EMAIL PROTECTED]
Sent: woensdag 12 maart 2003 12:05
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Don't Understand


Help!
 
I don't understand how to use the gdImageCopyResized
 
gdImageCopyResized(gdImagePtr dst, gdImagePtr src, int dstX, int dstY,
int srcX, int srcY, int destW, int destH, int srcW, int srcH)
 
Thanking You
 
 
Dallas Freeman
 
* is there a simpler way to change the size of an image?




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



RE: [PHP-DB] Don't Understand

2003-03-12 Thread Dallas Freeman

By the looks of it, I will have to create something in Delphi or
some-type of web application.

Thanks,

Dallas Freeman









-Original Message-
From: mike karthauser [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 12 March 2003 9:50 PM
To: Dallas Freeman
Subject: Re: [PHP-DB] Don't Understand

on 12/3/03 11:45 am, Dallas Freeman at [EMAIL PROTECTED] wrote:

 Thanks, very useful!  Can you direct me where for help on getting an
 image to resize before it is even uploaded (inother words, it will
 resize itself on the end-user's machine and then upload to the
 database).

I very much doubt that a server side script can do this. You need
something
clientside. We use macromedia fireworks.

-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ




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



RE: [PHP-DB] Don't Understand

2003-03-12 Thread Snijders, Mark
that's bull

on www.marksnijders.com and www.nederlandmobiel.nl i use those scripts (php
and the GD functions ) for automatically changing the file size...




-Original Message-
From: Dallas Freeman [mailto:[EMAIL PROTECTED]
Sent: woensdag 12 maart 2003 12:58
To: 'mike karthauser'
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Don't Understand



By the looks of it, I will have to create something in Delphi or
some-type of web application.

Thanks,

Dallas Freeman









-Original Message-
From: mike karthauser [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 12 March 2003 9:50 PM
To: Dallas Freeman
Subject: Re: [PHP-DB] Don't Understand

on 12/3/03 11:45 am, Dallas Freeman at [EMAIL PROTECTED] wrote:

 Thanks, very useful!  Can you direct me where for help on getting an
 image to resize before it is even uploaded (inother words, it will
 resize itself on the end-user's machine and then upload to the
 database).

I very much doubt that a server side script can do this. You need
something
clientside. We use macromedia fireworks.

-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ




-- 
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] Don't Understand

2003-03-12 Thread mike karthauser
on 12/3/03 12:01 pm, Snijders, Mark at [EMAIL PROTECTED] wrote:

 on www.marksnijders.com and www.nederlandmobiel.nl i use those scripts (php
 and the GD functions ) for automatically changing the file size...

Yeah but GD's server side...

Unless they have something installed on their client machine then you're
going to have to do it server side.

Your script will upload and then resize.
-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ


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



RE: [PHP-DB] Real Killer App!

2003-03-12 Thread Rich Gray
 I'm having a heck of a time trying to write a little web crawler for my
 intranet. I've got everything functionally working it seems like, but
 there is a very strange problem I can't nail down. If I put in an entry
 and start the crawler it goes great through the first loop. It gets the
 url, gets the page info, puts it in the database, and then parses all of
 the links out and puts them raw into the database. On the second loop it
 picks up all the new stuff and does the same thing. By the time the
 second loop is completed I'll have just over 300 items in the database.
 On the third loop is where the problem starts. Once it gets into the
 third loop, it starts to slow down a lot. Then, after a while, if I'm
 running from the command line, it'll just go to a command prompt. If I'm
 running in a browser, it returns a document contains no data error.
 This is with php 4.3.1 on a win2000 server. Haven't tried it on a linux
 box yet, but I'd rather run it on the windows server since it's bigger
 and has plenty of cpu, memory, and raid space. It's almost like the
 thing is getting confused when it starts to get more than 300 entries in
 the database. Any ideas out there as to what would cause this kind of
 problem?

 Nick

Can you post some code? Are your script timeouts set appropriately? Does
memory/CPU useage increase dramatically or are there any other symptoms of
where it is choking...? What DB is it updating? What does the database tell
you is happening when it starts choking? What do debug messages tell you wrt
finding the bottleneck? Does it happen always no matter what start point is
used? Are you using recursive functions?

Sorry lots of questions but no answers... :)

Cheers
Rich


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



Re: [PHP-DB] php, mssql and french accents

2003-03-12 Thread Benjamin MAsdoua
hi,


The charset used on my sql server is :

Character Set = 1, iso_1
ISO 8859-1 (Latin-1) - Western European 8-bit character set.


Where can I change these settings ?

Ben

[EMAIL PROTECTED] (Edwin Boersma) wrote in
news:[EMAIL PROTECTED]: 

 Your code page setting might be wrong.
 
 
 Edwin
 
 Benjamin Masdoua wrote:
 Hello,
 
 I'm developping an application using php and mssql.
 I have problems with french accents,
 when I insert something from php, and i consult it by enterprise
 manager (sql server) the accents are replaced, example paté becomes
 patÚ and if I insert something from enterprise manager and get teh
 value by php, the accents are also replaced and not by the same as
 the first situation example : paté becomes pat,
 
 any idea ?
 
 Benjamin Masdoua
 ABS-Integration
 Toulouse.
 
 
 


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



[PHP-DB] session and header(location....)

2003-03-12 Thread Lars Rasmussen
Hi everyone,

Thanks for looking at my question!

Well, i just made a script that firstly check's up username and password
(log-in script) then next if the user enteret the correct information a
session is set like this:
  session_id($sessid);
  session_start();
  $_SESSION['ngskdsngjkla465gfdh'] = LOGETIN-TRUE;

But then when this session is set it changes from the log in page to the
real password-protected page.
I tried with a normal header location, but it did'nt work, so i tried to
look at php.net about sessions, it says that you're had to transfer the
sessionid to the next page. Now i'm trying that, but it just wount
work...
The header location im using looks like this:
header(Location:
http://www.domain.tld/admin/index.php?PHPSESSID=.sessid);
And i also tried with:
header(Location:
http://www.domain.tld/admin/index.php?PHPSESSID=.$sessid);

But none of them will worki hope you will look at it, and tell me if
you have a solution.

Thanks folks.

Regards.
Lars Rasmussen


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



RE: [PHP-DB] Don't Understand

2003-03-12 Thread Mark

--- Snijders, Mark [EMAIL PROTECTED] wrote:
 that's bull
 
 on www.marksnijders.com and www.nederlandmobiel.nl i use those
 scripts (php
 and the GD functions ) for automatically changing the file size...
 
I think you're missing what he's saying. He's not saying that you
can't resize an image that's already been uploaded. Obviously you can
using the image*() functions. I believe he was saying that a
server-side app (or scripting language like PHP) cannot do ANYTHING
to a file, including resize it, **before** it's been uploaded.


 
 
 -Original Message-
 From: Dallas Freeman [mailto:[EMAIL PROTECTED]
 Sent: woensdag 12 maart 2003 12:58
 To: 'mike karthauser'
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Don't Understand
 
 
 
 By the looks of it, I will have to create something in Delphi or
 some-type of web application.
 
 Thanks,
 
 Dallas Freeman
 
 
 
 
 
 
 
 
 
 -Original Message-
 From: mike karthauser [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, 12 March 2003 9:50 PM
 To: Dallas Freeman
 Subject: Re: [PHP-DB] Don't Understand
 
 on 12/3/03 11:45 am, Dallas Freeman at [EMAIL PROTECTED] wrote:
 
  Thanks, very useful!  Can you direct me where for help on getting
 an
  image to resize before it is even uploaded (inother words, it
 will
  resize itself on the end-user's machine and then upload to the
  database).
 
 I very much doubt that a server side script can do this. You need
 something
 clientside. We use macromedia fireworks.
 
 -- 
 Mike Karthauser 
 Managing Director - Brightstorm Ltd
 
 Email[EMAIL PROTECTED]
 Web  http://www.brightstorm.co.uk
 Tel  0117 9426653 (office)
07939 252144 (mobile)
 
 SnailmailUnit 8, 14 King Square,
Bristol BS2 8JJ
 
 
 
 
 -- 
 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
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

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



[PHP-DB] MySQL Query help please!

2003-03-12 Thread Griffiths, Daniel
Hi all,

I have 2 tables that I need to extract data from, say PORTS and STATS.

PORTS contains a list of Sea Ports in PORT i.e. : -

PORTS.PORT

UK
FRANCE
GERMANY
NETHERLANDS
SPAIN
ITALY
  
STATS contains a few thousand records that with among other things has the elements 
TO_PORT and AMOUNT.

the entries in TO_PORT match the ports in PORT.

Now one of the things I want to do is produce a summary of the totals of AMOUNT 
against the ports in PORTS, including (and this is the important bit that I'm stuck 
on) the ports in PORTS that do not have a match in STATS.TO_PORT. so that I get a 
result such as : -

UK  300
FRANCE  100
GERMANY 400
NETHERLANDS 0
SPAIN   0
ITALY   300

and NOT :-

UK  300
FRANCE  100
GERMANY 400
ITALY   300

Which is all I can get at the moment.

the query I am using is : -

SELECT PORTS.PORT, SUM(STATS.AMOUNT) FROM PORTS LEFT JOIN STATS ON PORTS.PORT = 
STATS.TO_PORT GROUP BY PORTS.PORT

Basicaly what I want to do is pull out a list of all entries in PORTS.PORT and put a 
total figure against it from STATS.AMOUNT where the STATS.TO_PORT matches PORTS.PORT 
and just a zero if theres no entry in STATS.

Anyone got any ideas?

Thanks

Dan


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



[PHP-DB] Re: Real Killer App!

2003-03-12 Thread Nelson Goforth
Do you lock out the URLs that have already been indexed?  I'm 
wondering if your system is going into an endless loop?

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


Re: [PHP-DB] MySQL Query help please!

2003-03-12 Thread Mark
I just set up a test db using your info, and the query you have
worked ok. It provided a zero. Here's what I have (slightly modified
from yours, but not appreciably).

select ports.port, sum(stats.amount) as Total from ports left join
stats on ports.port=stats.to_port group by ports.port order by Total
desc

Data:
Ports
-
UK
France
Germany
Italy

Stats
-
France  1000
Italy   3000
UK  2000
France  1000
UK  5000

Result:
UK  7000
Italy   3000
France  2000
Germany 0

--- Griffiths, Daniel [EMAIL PROTECTED] wrote:
 Hi all,
 
 I have 2 tables that I need to extract data from, say PORTS and
 STATS.
 
 PORTS contains a list of Sea Ports in PORT i.e. : -
 
 PORTS.PORT
 
 UK
 FRANCE
 GERMANY
 NETHERLANDS
 SPAIN
 ITALY
   
 STATS contains a few thousand records that with among other things
 has the elements TO_PORT and AMOUNT.
 
 the entries in TO_PORT match the ports in PORT.
 
 Now one of the things I want to do is produce a summary of the
 totals of AMOUNT against the ports in PORTS, including (and this is
 the important bit that I'm stuck on) the ports in PORTS that do not
 have a match in STATS.TO_PORT. so that I get a result such as : -
 
 UK300
 FRANCE100
 GERMANY   400
 NETHERLANDS   0
 SPAIN 0
 ITALY 300
 
 and NOT :-
 
 UK300
 FRANCE100
 GERMANY   400
 ITALY 300
 
 Which is all I can get at the moment.
 
 the query I am using is : -
 
 SELECT PORTS.PORT, SUM(STATS.AMOUNT) FROM PORTS LEFT JOIN STATS ON
 PORTS.PORT = STATS.TO_PORT GROUP BY PORTS.PORT
 
 Basicaly what I want to do is pull out a list of all entries in
 PORTS.PORT and put a total figure against it from STATS.AMOUNT
 where the STATS.TO_PORT matches PORTS.PORT and just a zero if
 theres no entry in STATS.
 
 Anyone got any ideas?
 
 Thanks
 
 Dan
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

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



[PHP-DB] session and header(location....)

2003-03-12 Thread Lars Rasmussen
Hi everyone,

Thanks for looking at my question!

Well, i just made a script that firstly check's up username and password
(log-in script) then next if the user enteret the correct information a
session is set like this:
  session_id($sessid);
  session_start();
  $_SESSION['ngskdsngjkla465gfdh'] = LOGETIN-TRUE;

But then when this session is set it changes from the log in page to the
real password-protected page.
I tried with a normal header location, but it did'nt work, so i tried to
look at php.net about sessions, it says that you're had to transfer the
sessionid to the next page. Now i'm trying that, but it just wount
work...
The header location im using looks like this:
header(Location:
http://www.domain.tld/admin/index.php?PHPSESSID=.sessid);
And i also tried with:
header(Location:
http://www.domain.tld/admin/index.php?PHPSESSID=.$sessid);

But none of them will worki hope you will look at it, and tell me if
you have a solution.

Thanks folks.

Regards.
Lars Rasmussen


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



RE: [PHP-DB] session and header(location....)

2003-03-12 Thread George Pitcher
Lars,

I'm not sure if this is related (possibly), but I has similar problems with
cookies.

I doiscovered that the cookie was only being set if the page that set it
actually produced HTML. By redirecting, you cut out the HTML-writing.

Why not redirect the user if the test fails instead.

HTH

George

 -Original Message-
 From: Lars Rasmussen [mailto:[EMAIL PROTECTED]
 Sent: 12 March 2003 3:40 pm
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] session and header(location)


 Hi everyone,

 Thanks for looking at my question!

 Well, i just made a script that firstly check's up username and password
 (log-in script) then next if the user enteret the correct information a
 session is set like this:
   session_id($sessid);
   session_start();
   $_SESSION['ngskdsngjkla465gfdh'] = LOGETIN-TRUE;

 But then when this session is set it changes from the log in page to the
 real password-protected page.
 I tried with a normal header location, but it did'nt work, so i tried to
 look at php.net about sessions, it says that you're had to transfer the
 sessionid to the next page. Now i'm trying that, but it just wount
 work...
 The header location im using looks like this:
   header(Location:
 http://www.domain.tld/admin/index.php?PHPSESSID=.sessid);
 And i also tried with:
   header(Location:
 http://www.domain.tld/admin/index.php?PHPSESSID=.$sessid);

 But none of them will worki hope you will look at it, and tell me if
 you have a solution.

 Thanks folks.

 Regards.
 Lars Rasmussen


 --
 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] Re: Real Killer App!

2003-03-12 Thread Nicholas Fitzgerald
Well, I'm not locking them out exactly, but for good reason. When a url 
is first submitted it goes into the database with a checksum value of 0 
and a date of -00-00.  If the checksum is 0 the spider will process 
that url and update the record with the proper info. If the checksum is 
not 0, then it checks the date. If the date is passed the date for 
reindexing then it goes ahead and updates the record, it also checks 
against the checksum to see if the url has changed, in which case it 
updates.

It does look like it's going into an endless loop, but the strange thing 
is that it goes through the loop successfully a couple of times first. 
That's what's got me confused.

Nick

Nelson Goforth wrote:

Do you lock out the URLs that have already been indexed?  I'm 
wondering if your system is going into an endless loop?






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


RE: [PHP-DB] MySQL Query help please!

2003-03-12 Thread Griffiths, Daniel
urm, so it does..,

thank you for your polite reply, I had included a month element in my query but left 
it out cos i didnt think it made a dufference, of course i was using a where month = 1 
clause after the ON bit which was limiting the link to those records, duh!

cheers

Dan

-Original Message-
From: Mark [mailto:[EMAIL PROTECTED]
Sent: 12 March 2003 15:36
To: Griffiths, Daniel
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Query help please!


I just set up a test db using your info, and the query you have
worked ok. It provided a zero. Here's what I have (slightly modified
from yours, but not appreciably).

select ports.port, sum(stats.amount) as Total from ports left join
stats on ports.port=stats.to_port group by ports.port order by Total
desc

Data:
Ports
-
UK
France
Germany
Italy

Stats
-
France  1000
Italy   3000
UK  2000
France  1000
UK  5000

Result:
UK  7000
Italy   3000
France  2000
Germany 0

--- Griffiths, Daniel [EMAIL PROTECTED] wrote:
 Hi all,
 
 I have 2 tables that I need to extract data from, say PORTS and
 STATS.
 
 PORTS contains a list of Sea Ports in PORT i.e. : -
 
 PORTS.PORT
 
 UK
 FRANCE
 GERMANY
 NETHERLANDS
 SPAIN
 ITALY
   
 STATS contains a few thousand records that with among other things
 has the elements TO_PORT and AMOUNT.
 
 the entries in TO_PORT match the ports in PORT.
 
 Now one of the things I want to do is produce a summary of the
 totals of AMOUNT against the ports in PORTS, including (and this is
 the important bit that I'm stuck on) the ports in PORTS that do not
 have a match in STATS.TO_PORT. so that I get a result such as : -
 
 UK300
 FRANCE100
 GERMANY   400
 NETHERLANDS   0
 SPAIN 0
 ITALY 300
 
 and NOT :-
 
 UK300
 FRANCE100
 GERMANY   400
 ITALY 300
 
 Which is all I can get at the moment.
 
 the query I am using is : -
 
 SELECT PORTS.PORT, SUM(STATS.AMOUNT) FROM PORTS LEFT JOIN STATS ON
 PORTS.PORT = STATS.TO_PORT GROUP BY PORTS.PORT
 
 Basicaly what I want to do is pull out a list of all entries in
 PORTS.PORT and put a total figure against it from STATS.AMOUNT
 where the STATS.TO_PORT matches PORTS.PORT and just a zero if
 theres no entry in STATS.
 
 Anyone got any ideas?
 
 Thanks
 
 Dan
 
 
 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

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



[PHP-DB] Easy array question...

2003-03-12 Thread NIPP, SCOTT V (SBCSI)
I create an array on one page and then process it on the next page
as I have registered the array as a session variable.  I need to basically
process one of these arrays twice, so I want to make a copy of the array.
The question is how do I do this?  I have tried the following:

$array2 = $array1;

This doesn't seem to do the trick for me.  Is this correct and I am
just missing something elsewhere, or is there another way to copy an array?
Thanks.

Scott Nipp
Phone:  (214) 858-1289
E-mail:  [EMAIL PROTECTED]
Web:  http:\\ldsa.sbcld.sbc.com



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



RE: [PHP-DB] Easy array question...

2003-03-12 Thread Hutchins, Richard
Are you using:

$array2 = $_SESSION[array1];

Not sure that will do the trick, but it was my first inclination.

Rich

 -Original Message-
 From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 11:37 AM
 To: '[EMAIL PROTECTED]'
 Subject: [PHP-DB] Easy array question...
 
 
   I create an array on one page and then process it on 
 the next page
 as I have registered the array as a session variable.  I need 
 to basically
 process one of these arrays twice, so I want to make a copy 
 of the array.
 The question is how do I do this?  I have tried the following:
 
 $array2 = $array1;
 
   This doesn't seem to do the trick for me.  Is this 
 correct and I am
 just missing something elsewhere, or is there another way to 
 copy an array?
 Thanks.
 
 Scott Nipp
 Phone:  (214) 858-1289
 E-mail:  [EMAIL PROTECTED]
 Web:  http:\\ldsa.sbcld.sbc.com
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



RE: [PHP-DB] Easy array question...

2003-03-12 Thread NIPP, SCOTT V (SBCSI)
I don't think that is the case because I am able to access the
original array in this same page without having to use the session variable
reference.  Won't hurt to give it a try though.  Thanks for the feedback.

-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:40 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...


Are you using:

$array2 = $_SESSION[array1];

Not sure that will do the trick, but it was my first inclination.

Rich

 -Original Message-
 From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 11:37 AM
 To: '[EMAIL PROTECTED]'
 Subject: [PHP-DB] Easy array question...
 
 
   I create an array on one page and then process it on 
 the next page
 as I have registered the array as a session variable.  I need 
 to basically
 process one of these arrays twice, so I want to make a copy 
 of the array.
 The question is how do I do this?  I have tried the following:
 
 $array2 = $array1;
 
   This doesn't seem to do the trick for me.  Is this 
 correct and I am
 just missing something elsewhere, or is there another way to 
 copy an array?
 Thanks.
 
 Scott Nipp
 Phone:  (214) 858-1289
 E-mail:  [EMAIL PROTECTED]
 Web:  http:\\ldsa.sbcld.sbc.com
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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

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



RE: [PHP-DB] Easy array question...

2003-03-12 Thread Jonathan Villa
$array_copy = array();
array_push($array_copy, $_SESSION['original_array']);

echo $array_copy[0];//or whatever to test

 
--- Jonathan
 
 
 
-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 10:43 AM
To: 'Hutchins, Richard'; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...

I don't think that is the case because I am able to access the
original array in this same page without having to use the session
variable
reference.  Won't hurt to give it a try though.  Thanks for the
feedback.

-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:40 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...


Are you using:

$array2 = $_SESSION[array1];

Not sure that will do the trick, but it was my first inclination.

Rich

 -Original Message-
 From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 11:37 AM
 To: '[EMAIL PROTECTED]'
 Subject: [PHP-DB] Easy array question...
 
 
   I create an array on one page and then process it on 
 the next page
 as I have registered the array as a session variable.  I need 
 to basically
 process one of these arrays twice, so I want to make a copy 
 of the array.
 The question is how do I do this?  I have tried the following:
 
 $array2 = $array1;
 
   This doesn't seem to do the trick for me.  Is this 
 correct and I am
 just missing something elsewhere, or is there another way to 
 copy an array?
 Thanks.
 
 Scott Nipp
 Phone:  (214) 858-1289
 E-mail:  [EMAIL PROTECTED]
 Web:  http:\\ldsa.sbcld.sbc.com
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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

-- 
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] Easy array question...

2003-03-12 Thread Jonathan Villa
Sorry, I just reread your post

$array_copy = array();
array_push($array_copy, $original_array);

echo $array_copy[0];//or whatever to test

 
--- Jonathan
 
 
 

-Original Message-
From: Jonathan Villa [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 10:56 AM
To: 'NIPP, SCOTT V (SBCSI)'; 'Hutchins, Richard'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Easy array question...

$array_copy = array();
array_push($array_copy, $_SESSION['original_array']);

echo $array_copy[0];//or whatever to test

 
--- Jonathan
 
 
 
-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 10:43 AM
To: 'Hutchins, Richard'; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...

I don't think that is the case because I am able to access the
original array in this same page without having to use the session
variable
reference.  Won't hurt to give it a try though.  Thanks for the
feedback.

-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:40 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...


Are you using:

$array2 = $_SESSION[array1];

Not sure that will do the trick, but it was my first inclination.

Rich

 -Original Message-
 From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 11:37 AM
 To: '[EMAIL PROTECTED]'
 Subject: [PHP-DB] Easy array question...
 
 
   I create an array on one page and then process it on 
 the next page
 as I have registered the array as a session variable.  I need 
 to basically
 process one of these arrays twice, so I want to make a copy 
 of the array.
 The question is how do I do this?  I have tried the following:
 
 $array2 = $array1;
 
   This doesn't seem to do the trick for me.  Is this 
 correct and I am
 just missing something elsewhere, or is there another way to 
 copy an array?
 Thanks.
 
 Scott Nipp
 Phone:  (214) 858-1289
 E-mail:  [EMAIL PROTECTED]
 Web:  http:\\ldsa.sbcld.sbc.com
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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

-- 
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Easy array question...

2003-03-12 Thread NIPP, SCOTT V (SBCSI)
Here is basically what I have and what I am getting...

The section of code to copy and then process the copied array:

$other2 = array();
array_push($other2, $other);

foreach ($other2 as $test) {
if ($test == ) {
echo NOTHING.br;
} else {
echo $test.br;
}
}

Basically, what I want is if the array element is nothing, then
output as a test NOTHING.  If the array element has some value, then output
as a test that value.  Currently, from this code the output I am actually
getting is:

Array

Thanks again.

-Original Message-
From: Jonathan Villa [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:58 AM
To: [EMAIL PROTECTED]; NIPP, SCOTT V (SBCSI); 'Hutchins, Richard';
[EMAIL PROTECTED]
Subject: RE: [PHP-DB] Easy array question...


Sorry, I just reread your post

$array_copy = array();
array_push($array_copy, $original_array);

echo $array_copy[0];//or whatever to test

 
--- Jonathan
 
 
 

-Original Message-
From: Jonathan Villa [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 10:56 AM
To: 'NIPP, SCOTT V (SBCSI)'; 'Hutchins, Richard'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Easy array question...

$array_copy = array();
array_push($array_copy, $_SESSION['original_array']);

echo $array_copy[0];//or whatever to test

 
--- Jonathan
 
 
 
-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 10:43 AM
To: 'Hutchins, Richard'; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...

I don't think that is the case because I am able to access the
original array in this same page without having to use the session
variable
reference.  Won't hurt to give it a try though.  Thanks for the
feedback.

-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:40 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...


Are you using:

$array2 = $_SESSION[array1];

Not sure that will do the trick, but it was my first inclination.

Rich

 -Original Message-
 From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 11:37 AM
 To: '[EMAIL PROTECTED]'
 Subject: [PHP-DB] Easy array question...
 
 
   I create an array on one page and then process it on 
 the next page
 as I have registered the array as a session variable.  I need 
 to basically
 process one of these arrays twice, so I want to make a copy 
 of the array.
 The question is how do I do this?  I have tried the following:
 
 $array2 = $array1;
 
   This doesn't seem to do the trick for me.  Is this 
 correct and I am
 just missing something elsewhere, or is there another way to 
 copy an array?
 Thanks.
 
 Scott Nipp
 Phone:  (214) 858-1289
 E-mail:  [EMAIL PROTECTED]
 Web:  http:\\ldsa.sbcld.sbc.com
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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

-- 
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Easy array question...

2003-03-12 Thread Jonathan Villa
Try it with the original array first, just for testing

 
--- Jonathan
 
 
 

-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 11:10 AM
To: '[EMAIL PROTECTED]'; 'Hutchins, Richard'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Easy array question...

Here is basically what I have and what I am getting...

The section of code to copy and then process the copied array:

$other2 = array();
array_push($other2, $other);

foreach ($other2 as $test) {
if ($test == ) {
echo NOTHING.br;
} else {
echo $test.br;
}
}

Basically, what I want is if the array element is nothing, then
output as a test NOTHING.  If the array element has some value, then
output
as a test that value.  Currently, from this code the output I am
actually
getting is:

Array

Thanks again.

-Original Message-
From: Jonathan Villa [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:58 AM
To: [EMAIL PROTECTED]; NIPP, SCOTT V (SBCSI); 'Hutchins, Richard';
[EMAIL PROTECTED]
Subject: RE: [PHP-DB] Easy array question...


Sorry, I just reread your post

$array_copy = array();
array_push($array_copy, $original_array);

echo $array_copy[0];//or whatever to test

 
--- Jonathan
 
 
 

-Original Message-
From: Jonathan Villa [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 10:56 AM
To: 'NIPP, SCOTT V (SBCSI)'; 'Hutchins, Richard'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Easy array question...

$array_copy = array();
array_push($array_copy, $_SESSION['original_array']);

echo $array_copy[0];//or whatever to test

 
--- Jonathan
 
 
 
-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 10:43 AM
To: 'Hutchins, Richard'; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...

I don't think that is the case because I am able to access the
original array in this same page without having to use the session
variable
reference.  Won't hurt to give it a try though.  Thanks for the
feedback.

-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:40 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...


Are you using:

$array2 = $_SESSION[array1];

Not sure that will do the trick, but it was my first inclination.

Rich

 -Original Message-
 From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 11:37 AM
 To: '[EMAIL PROTECTED]'
 Subject: [PHP-DB] Easy array question...
 
 
   I create an array on one page and then process it on 
 the next page
 as I have registered the array as a session variable.  I need 
 to basically
 process one of these arrays twice, so I want to make a copy 
 of the array.
 The question is how do I do this?  I have tried the following:
 
 $array2 = $array1;
 
   This doesn't seem to do the trick for me.  Is this 
 correct and I am
 just missing something elsewhere, or is there another way to 
 copy an array?
 Thanks.
 
 Scott Nipp
 Phone:  (214) 858-1289
 E-mail:  [EMAIL PROTECTED]
 Web:  http:\\ldsa.sbcld.sbc.com
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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

-- 
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP-DB] Re: Real Killer App!

2003-03-12 Thread Matthew Moldvan
Even if the system is working correctly the first couple times, it may go
into an endless loop if you do not specify the right conditions, for any
programming application ...

I am very curious about this project ... is it open source?  If so, I'd be
interested in taking a look at how you implemented it.

Thanks,
Matthew Moldvan.

System Administrator,
Trilogy International, Inc.
http://www.trilogyintl.com/

-Original Message-
From: Nicholas Fitzgerald [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 7:58 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Re: Real Killer App!


Well, I'm not locking them out exactly, but for good reason. When a url 
is first submitted it goes into the database with a checksum value of 0 
and a date of -00-00.  If the checksum is 0 the spider will process 
that url and update the record with the proper info. If the checksum is 
not 0, then it checks the date. If the date is passed the date for 
reindexing then it goes ahead and updates the record, it also checks 
against the checksum to see if the url has changed, in which case it 
updates.

It does look like it's going into an endless loop, but the strange thing 
is that it goes through the loop successfully a couple of times first. 
That's what's got me confused.

Nick

Nelson Goforth wrote:

 Do you lock out the URLs that have already been indexed?  I'm 
 wondering if your system is going into an endless loop?






-- 
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] Easy array question...

2003-03-12 Thread NIPP, SCOTT V (SBCSI)
GREAT.  This does the trick for me.  Thanks a lot.  I am now getting
the output I want, so I can now feel confident about inputting this into the
actual database.

-Original Message-
From: Katie Evans-Young [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 11:21 AM
To: NIPP, SCOTT V (SBCSI)
Subject: RE: [PHP-DB] Easy array question...


It's actually putting the whole of the array $other as the first element of
the array $other2. You're going to have to step through the array to copy
it.

foreach($other as $element) {
$other2[] = $element;
} //end foreach

-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 11:10 AM
To: '[EMAIL PROTECTED]'; 'Hutchins, Richard'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Easy array question...


Here is basically what I have and what I am getting...

The section of code to copy and then process the copied array:

$other2 = array();
array_push($other2, $other);

foreach ($other2 as $test) {
if ($test == ) {
echo NOTHING.br;
} else {
echo $test.br;
}
}

Basically, what I want is if the array element is nothing, then
output as a test NOTHING.  If the array element has some value, then output
as a test that value.  Currently, from this code the output I am actually
getting is:

Array

Thanks again.

-Original Message-
From: Jonathan Villa [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:58 AM
To: [EMAIL PROTECTED]; NIPP, SCOTT V (SBCSI); 'Hutchins, Richard';
[EMAIL PROTECTED]
Subject: RE: [PHP-DB] Easy array question...


Sorry, I just reread your post

$array_copy = array();
array_push($array_copy, $original_array);

echo $array_copy[0];//or whatever to test


--- Jonathan




-Original Message-
From: Jonathan Villa [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:56 AM
To: 'NIPP, SCOTT V (SBCSI)'; 'Hutchins, Richard'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Easy array question...

$array_copy = array();
array_push($array_copy, $_SESSION['original_array']);

echo $array_copy[0];//or whatever to test


--- Jonathan



-Original Message-
From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:43 AM
To: 'Hutchins, Richard'; '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...

I don't think that is the case because I am able to access the
original array in this same page without having to use the session
variable
reference.  Won't hurt to give it a try though.  Thanks for the
feedback.

-Original Message-
From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 10:40 AM
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Easy array question...


Are you using:

$array2 = $_SESSION[array1];

Not sure that will do the trick, but it was my first inclination.

Rich

 -Original Message-
 From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 11:37 AM
 To: '[EMAIL PROTECTED]'
 Subject: [PHP-DB] Easy array question...


   I create an array on one page and then process it on
 the next page
 as I have registered the array as a session variable.  I need
 to basically
 process one of these arrays twice, so I want to make a copy
 of the array.
 The question is how do I do this?  I have tried the following:

 $array2 = $array1;

   This doesn't seem to do the trick for me.  Is this
 correct and I am
 just missing something elsewhere, or is there another way to
 copy an array?
 Thanks.

 Scott Nipp
 Phone:  (214) 858-1289
 E-mail:  [EMAIL PROTECTED]
 Web:  http:\\ldsa.sbcld.sbc.com



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


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

--
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 1/21/2003

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 1/21/2003

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



[PHP-DB] newsletter optimization help needed

2003-03-12 Thread Chris Payne
Hi there Everyone,
 
Below is some code I use to send a newsletter to clients subscribed on
my mailing list.  The problem is I have over
9000+ email addresses in the DB and it takes around 30-45 minutes to
send them with the below code.
 
Can anyone see someway I can optimize it so it sends out the newsletter
any faster?  I've probably gone about
this system the long way, but it works - I just need to find a way to
make it faster :-(
 
Thanks everyone
 
All the best
 
Chris
 
---
 
?
 
$connection = mysql_connect(localhost,Username,Password) or
die(Couldn't make a connection.);
 
$db = mysql_select_db(WhateverDB, $connection)
or die(Couldn't select database.);
 
$sql = SELECT *
FROM emailtest;
 
$sql_result = mysql_query($sql,$connection)
or die(Couldn't execute query.);
 
while ($row = mysql_fetch_array($sql_result)) {
$emailadd = $row[EMail];
$emailname = $row[emailname];
$emailphone = $row[emailphone];
$emailaddress = $row[emailaddress];
 
$MP = sendmail -t;
$HT = htmlbody;
$HT = /body/html;
$subject = $subject;
$NOTE = $emailtests;
 
$NOTE = str_replace(*email*, $emailadd, $NOTE);
$NOTE = str_replace(*name*, $emailname, $NOTE);
$NOTE = str_replace(*phone*, $emailphone, $NOTE);
$NOTE = str_replace(*address*, $emailaddress, $NOTE);
 
$TO = $emailadd; 
$fd = popen($MP,w); 
fputs($fd,MIME-Version: 1.0\r\n);
fputs($fd,Content-type: text/html; charset=iso-8859-1\r\n);
fputs($fd, To: $TO\n); 
fputs($fd, From: [EMAIL PROTECTED]); 
fputs($fd, Subject: $subject\n); 
fputs($fd, X-Mailer: PHP3\n);  
fputs($fd, Email: $email\n);
fputs($fd, $HT);
fputs($fd, $NOTE);
fputs($fd, $EHT);
 
}
 
pclose($fd); 
exit; 
 
mysql_free_result($sql_result);
mysql_close($connection);
?


[PHP-DB] how to show online members.

2003-03-12 Thread Smita Manohar
hello all,
im writting code for discussion forum. can any one give any idea about how 
to show online status of members on and off ?
- smita.



_
Get ball by ball action on your desktop. 
http://server1.msn.co.in/msnspecials/cricketdownload/contest.asp Get Hutch 
MSN Cricketer

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


[PHP-DB] how to show online members.

2003-03-12 Thread Smita Manohar
hello all,
im writting code for discussion forum. can any one give any idea about how 
to show online status of members on and off ?
- smita.



_
Get ball by ball action on your desktop. 
http://server1.msn.co.in/msnspecials/cricketdownload/contest.asp Get Hutch 
MSN Cricketer

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


RE: [PHP-DB] newsletter optimization help needed

2003-03-12 Thread SELPH,JASON (HP-Richardson,ex1)
You could change the TO: to something generic like Email List Subscriber
then add everyone to the BCC field and then generate 1 email with 9000
people in the BCC field.  Let sendmail do the rest.  It should take less
time to send the emails and only a few seconds to generate your page.

Cheers
Jason

-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 11:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] newsletter optimization help needed


Hi there Everyone,
 
Below is some code I use to send a newsletter to clients subscribed on my
mailing list.  The problem is I have over
9000+ email addresses in the DB and it takes around 30-45 minutes to
send them with the below code.
 
Can anyone see someway I can optimize it so it sends out the newsletter any
faster?  I've probably gone about this system the long way, but it works - I
just need to find a way to make it faster :-(
 
Thanks everyone
 
All the best
 
Chris
 
---
 
?
 
$connection = mysql_connect(localhost,Username,Password) or
die(Couldn't make a connection.);
 
$db = mysql_select_db(WhateverDB, $connection)
or die(Couldn't select database.);
 
$sql = SELECT *
FROM emailtest;
 
$sql_result = mysql_query($sql,$connection)
or die(Couldn't execute query.);
 
while ($row = mysql_fetch_array($sql_result)) {
$emailadd = $row[EMail];
$emailname = $row[emailname];
$emailphone = $row[emailphone];
$emailaddress = $row[emailaddress];
 
$MP = sendmail -t;
$HT = htmlbody;
$HT = /body/html;
$subject = $subject;
$NOTE = $emailtests;
 
$NOTE = str_replace(*email*, $emailadd, $NOTE);
$NOTE = str_replace(*name*, $emailname, $NOTE);
$NOTE = str_replace(*phone*, $emailphone, $NOTE);
$NOTE = str_replace(*address*, $emailaddress, $NOTE);
 
$TO = $emailadd; 
$fd = popen($MP,w); 
fputs($fd,MIME-Version: 1.0\r\n);
fputs($fd,Content-type: text/html; charset=iso-8859-1\r\n); fputs($fd,
To: $TO\n); 
fputs($fd, From: [EMAIL PROTECTED]); 
fputs($fd, Subject: $subject\n); 
fputs($fd, X-Mailer: PHP3\n);  
fputs($fd, Email: $email\n);
fputs($fd, $HT);
fputs($fd, $NOTE);
fputs($fd, $EHT);
 
}
 
pclose($fd); 
exit; 
 
mysql_free_result($sql_result);
mysql_close($connection);
?

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



Re: [PHP-DB] how to show online members.

2003-03-12 Thread Jim Hunter
There was a post yesterday on PHP Classes that is this very thing. Go to www
PHPclasses.org and search for UsersOnline2.

This should help you out a bunch

Jim hunter
 
---Original Message---
 
From: Smita Manohar
Date: Wednesday, March 12, 2003 09:59:42 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] how to show online members.
 
hello all,
im writting code for discussion forum. can any one give any idea about how 
to show online status of members on and off ?
- smita.



_
Get ball by ball action on your desktop. 
http://server1.msn.co.in/msnspecials/cricketdownload/contest.asp Get Hutch 
MSN Cricketer


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

. 

Re: [PHP-DB] Real Killer App!

2003-03-12 Thread Nicholas Fitzgerald


Rich Gray wrote:

I'm having a heck of a time trying to write a little web crawler for my
intranet. I've got everything functionally working it seems like, but
there is a very strange problem I can't nail down. If I put in an entry
and start the crawler it goes great through the first loop. It gets the
url, gets the page info, puts it in the database, and then parses all of
the links out and puts them raw into the database. On the second loop it
picks up all the new stuff and does the same thing. By the time the
second loop is completed I'll have just over 300 items in the database.
On the third loop is where the problem starts. Once it gets into the
third loop, it starts to slow down a lot. Then, after a while, if I'm
running from the command line, it'll just go to a command prompt. If I'm
running in a browser, it returns a document contains no data error.
This is with php 4.3.1 on a win2000 server. Haven't tried it on a linux
box yet, but I'd rather run it on the windows server since it's bigger
and has plenty of cpu, memory, and raid space. It's almost like the
thing is getting confused when it starts to get more than 300 entries in
the database. Any ideas out there as to what would cause this kind of
problem?
Nick
   

Can you post some code? Are your script timeouts set appropriately? Does
memory/CPU useage increase dramatically or are there any other symptoms of
where it is choking...? What DB is it updating? What does the database tell
you is happening when it starts choking? What do debug messages tell you wrt
finding the bottleneck? Does it happen always no matter what start point is
used? Are you using recursive functions?
Sorry lots of questions but no answers... :)

Cheers
Rich
 

Recognizing that this script would take a long time to run I'm using 
set_time_limit(0) in it so a timeout doesn't become an issue. The server 
has 1.5 gig of memory and is a dual processor 1GHz PIII. I have never 
seen it get over 15% cpu usage, even while this is going on, and it 
never gets anywhere near full memory usage. The tax on the system itself 
is actually negligable. There are no symptoms that I can find to 
indicate where the chokepoint might be. It seems to be when the DB 
reaches a certain size, but 300 or so records should be a piece of cake 
for it. As far as the debug backtrace, there really isn't anything there 
that stands out. It's not an issue with a variable, something is going 
wrong in the execution either of php, or a sql query. I'm not finding 
any errors in the mysql error log, or anywhere else.

Basically the prog is in two parts. First, it goes and gets the current 
contents of the DB, one record at a time, and checks it. If it meets the 
criteria it is then indexed or reindexed. If it is indexed, then it goes 
to the second part. This is where it strips any links from the page and 
puts them in the DB for indexing, if thery're not already there. When it 
dies, this is where it dies. I'll get the UPDATING: titleurl 
message that comes up when it does an update, but at that point, where 
it is going into strip links, it dies right there.

Nick

 



Re: [PHP-DB] newsletter optimization help needed

2003-03-12 Thread Jason Wong
On Thursday 13 March 2003 02:14, Chris Payne wrote:

 That makes sense :-)  One question, my brain is kind of dead today (Some
 would say always :-)  But how would I get $emailadd to display all the
 addresses in the bcc bit?  I know you have to add the addresses, seperate
 them with a , etc . but for the life of me I can't think straight right
 now :-(

The easiest method is to stick them all into an array then implode them using 
a comma as the delimiter.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
Love isn't only blind, it's also deaf, dumb, and stupid.
*/


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



RE: [PHP-DB] newsletter optimization help needed

2003-03-12 Thread SELPH,JASON (HP-Richardson,ex1)
You could form them into an array and then use implode with whatever
delimiter sendmail uses (unless you changed it I believe it is just a
comma).  To test it, try limiting your select statement to the first 50 or
so, then echo everything into a test output page.  Then try with a defined
limit of 1 or 2 to email it to a few test email accounts (hotmail or
whatever) and see if it all works.  I stress this as I may have accidently
at one time in the past tried a test similar to yours with live data.
Needless to say our exchange admin was a bit unhappy.

Jason

-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 12:14 PM
To: php
Subject: Re: [PHP-DB] newsletter optimization help needed


Hi there.

That makes sense :-)  One question, my brain is kind of dead today (Some
would say always :-)  But how would I get $emailadd to display all the
addresses in the bcc bit?  I know you have to add the addresses, seperate
them with a , etc . but for the life of me I can't think straight right
now :-(

Thanks

Chris
---
while ($row = mysql_fetch_array($sql_result)) {
 $emailadd = $row[EMail];
 $emailname = $row[emailname];
 $emailphone = $row[emailphone];
 $emailaddress = $row[emailaddress];

};

 You could change the TO: to something generic like Email List 
 Subscriber then add everyone to the BCC field and then generate 1 
 email with 9000 people in the BCC field.  Let sendmail do the rest.  
 It should take less time to send the emails and only a few seconds to 
 generate your page.


-- 
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] Real Killer App!

2003-03-12 Thread Jim Hunter
Just a guess, but do you have an index on the table that you are using to
store the URLs that still need to be parsed? This table is going to get
huge! And if you do not delete the URL that you just parsed from the list it
will grow even faster. And if you do not have an index on that table and you
are doing a table scan to see if the new URL is in it or not, this is going
to take longer and longer to complete every time you process another URL.
This is because this temp table of URLs to process will always get larger,
and will rarely go down in size because you add about 5+ new URLs for every
one that you process. 
But then again, we don't know for sure on anything without seeing 'some'
code. So far we have not seen any so everything is total speculation and
guessing. I would be interested in seeing the code that handles the
processing of the URLs once you cull them from a web page. 

Jim Hunter


 
---Original Message---
 
From: Nicholas Fitzgerald
Date: Wednesday, March 12, 2003 10:15:52 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Real Killer App!
 

Rich Gray wrote:

I'm having a heck of a time trying to write a little web crawler for my
intranet. I've got everything functionally working it seems like, but
there is a very strange problem I can't nail down. If I put in an entry
and start the crawler it goes great through the first loop. It gets the
url, gets the page info, puts it in the database, and then parses all of
the links out and puts them raw into the database. On the second loop it
picks up all the new stuff and does the same thing. By the time the
second loop is completed I'll have just over 300 items in the database.
On the third loop is where the problem starts. Once it gets into the
third loop, it starts to slow down a lot. Then, after a while, if I'm
running from the command line, it'll just go to a command prompt. If I'm
running in a browser, it returns a document contains no data error.
This is with php 4.3.1 on a win2000 server. Haven't tried it on a linux
box yet, but I'd rather run it on the windows server since it's bigger
and has plenty of cpu, memory, and raid space. It's almost like the
thing is getting confused when it starts to get more than 300 entries in
the database. Any ideas out there as to what would cause this kind of
problem?

Nick
 


Can you post some code? Are your script timeouts set appropriately? Does
memory/CPU useage increase dramatically or are there any other symptoms of
where it is choking...? What DB is it updating? What does the database tell
you is happening when it starts choking? What do debug messages tell you
wrt
finding the bottleneck? Does it happen always no matter what start point is
used? Are you using recursive functions?

Sorry lots of questions but no answers... :)

Cheers
Rich
 

Recognizing that this script would take a long time to run I'm using 
set_time_limit(0) in it so a timeout doesn't become an issue. The server 
has 1.5 gig of memory and is a dual processor 1GHz PIII. I have never 
seen it get over 15% cpu usage, even while this is going on, and it 
never gets anywhere near full memory usage. The tax on the system itself 
is actually negligable. There are no symptoms that I can find to 
indicate where the chokepoint might be. It seems to be when the DB 
reaches a certain size, but 300 or so records should be a piece of cake 
for it. As far as the debug backtrace, there really isn't anything there 
that stands out. It's not an issue with a variable, something is going 
wrong in the execution either of php, or a sql query. I'm not finding 
any errors in the mysql error log, or anywhere else.

Basically the prog is in two parts. First, it goes and gets the current 
contents of the DB, one record at a time, and checks it. If it meets the 
criteria it is then indexed or reindexed. If it is indexed, then it goes 
to the second part. This is where it strips any links from the page and 
puts them in the DB for indexing, if thery're not already there. When it 
dies, this is where it dies. I'll get the UPDATING: titleurl 
message that comes up when it does an update, but at that point, where 
it is going into strip links, it dies right there.

Nick

 


Re: [PHP-DB] Re: Real Killer App!

2003-03-12 Thread Nicholas Fitzgerald
I think at this point, as I've been working on it the past few hours, I 
can safely say that it is NOT going into an endless loop. It's just 
dying at a certain point. Interestingly, it always seems to dies at the 
same point. When indexing a particular site, I noticed that it was dying 
on a certain url. I also noticed that it was trying to index some .jpg 
and .gif files. I put in a filter so it wouldn't do anything with those 
binary files, and then re ran the app. Now, with a lot less files to go 
through and hence a lot less work to do, it still died on the same url 
as before. I then cleared the database and put in that specific URL and 
started there. It indexed that fine and did what it was supposed to do. 
No matter what though, if I start at the root of the site, or anywhere 
else, it dies right there. I've also noticed that when it gets to the 
point where it's dying the hard drive does a massive write. 
Interestingly, this happens on the boot drive, and not the raid array 
where the database, php, and the webserver live. I've got a fairly 
sizable swapfile on both drives, and 1.5 gig of memory. I can't imagine 
it's a memory problem, but you never know.

I believe I have the right conditions specified, but I do plan to go and 
review all of that both in the app and in the server environment. As for 
the status of the code, I'm not sure yet. I need to make something from 
this, and I haven't quite figured out yet how people make money from 
open source without charging a fortune for support. I'd rather charge 
less up front and support it for free, but we'll see what happens.

Nick

Matthew Moldvan wrote:

Even if the system is working correctly the first couple times, it may go
into an endless loop if you do not specify the right conditions, for any
programming application ...
I am very curious about this project ... is it open source?  If so, I'd be
interested in taking a look at how you implemented it.
Thanks,
Matthew Moldvan.
System Administrator,
Trilogy International, Inc.
http://www.trilogyintl.com/
-Original Message-
From: Nicholas Fitzgerald [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 7:58 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Re: Real Killer App!
Well, I'm not locking them out exactly, but for good reason. When a url 
is first submitted it goes into the database with a checksum value of 0 
and a date of -00-00.  If the checksum is 0 the spider will process 
that url and update the record with the proper info. If the checksum is 
not 0, then it checks the date. If the date is passed the date for 
reindexing then it goes ahead and updates the record, it also checks 
against the checksum to see if the url has changed, in which case it 
updates.

It does look like it's going into an endless loop, but the strange thing 
is that it goes through the loop successfully a couple of times first. 
That's what's got me confused.

Nick

Nelson Goforth wrote:

 

Do you lock out the URLs that have already been indexed?  I'm 
wondering if your system is going into an endless loop?

   





 




RE: [PHP-DB] newsletter optimization help needed

2003-03-12 Thread Miles Thompson
I've been doing that with a much smaller list, and we periodically run into 
problems with subscribers SPAM filter, double-propagation of some 
addresses, etc.  I think the days of bcc: are numbered.

The approach we're working on now is to send an URL to subscribers. They 
click on that and view the newsletter through Flash player.

As for Chris's problem, I don't know. I'd be tempted to have the PHP script 
pass a set of parameters to a Python script and then end. When the Python 
script completes have that email the results to the user. A friend of mine 
used a similar process to handle requests for huge amounts of geological 
data. The parameters were passed to the database which generated the file 
and called a script to mail them. The original page was long since gone.

Miles

At 09:56 AM 3/12/2003 -0800, SELPH,JASON (HP-Richardson,ex1) wrote:
You could change the TO: to something generic like Email List Subscriber
then add everyone to the BCC field and then generate 1 email with 9000
people in the BCC field.  Let sendmail do the rest.  It should take less
time to send the emails and only a few seconds to generate your page.
Cheers
Jason
-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 12, 2003 11:41 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] newsletter optimization help needed
Hi there Everyone,

Below is some code I use to send a newsletter to clients subscribed on my
mailing list.  The problem is I have over
9000+ email addresses in the DB and it takes around 30-45 minutes to
send them with the below code.
Can anyone see someway I can optimize it so it sends out the newsletter any
faster?  I've probably gone about this system the long way, but it works - I
just need to find a way to make it faster :-(
Thanks everyone

All the best

Chris

---

?

$connection = mysql_connect(localhost,Username,Password) or
die(Couldn't make a connection.);
$db = mysql_select_db(WhateverDB, $connection)
or die(Couldn't select database.);
$sql = SELECT *
FROM emailtest;
$sql_result = mysql_query($sql,$connection)
or die(Couldn't execute query.);
while ($row = mysql_fetch_array($sql_result)) {
$emailadd = $row[EMail];
$emailname = $row[emailname];
$emailphone = $row[emailphone];
$emailaddress = $row[emailaddress];
$MP = sendmail -t;
$HT = htmlbody;
$HT = /body/html;
$subject = $subject;
$NOTE = $emailtests;
$NOTE = str_replace(*email*, $emailadd, $NOTE);
$NOTE = str_replace(*name*, $emailname, $NOTE);
$NOTE = str_replace(*phone*, $emailphone, $NOTE);
$NOTE = str_replace(*address*, $emailaddress, $NOTE);
$TO = $emailadd;
$fd = popen($MP,w);
fputs($fd,MIME-Version: 1.0\r\n);
fputs($fd,Content-type: text/html; charset=iso-8859-1\r\n); fputs($fd,
To: $TO\n);
fputs($fd, From: [EMAIL PROTECTED]);
fputs($fd, Subject: $subject\n);
fputs($fd, X-Mailer: PHP3\n);
fputs($fd, Email: $email\n);
fputs($fd, $HT);
fputs($fd, $NOTE);
fputs($fd, $EHT);
}

pclose($fd);
exit;
mysql_free_result($sql_result);
mysql_close($connection);
?
--
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] Define()

2003-03-12 Thread Jonathan Villa

I am developing an app which needs 3 constants.  The value of these
constants comes from a database result.

This works fine.  My problem is that they do not work very well.  I am
developing on both windows/Linux (depending what I boot into).

This is the effect I want

$doc_dir = the string of d:/is/clients/client/web/store/
$image_dir = the string of d:/is/clients/client/web/images/
$control_dir = the string of d:/is/clients/client/web/control/ 

define(HOME_DOC_ROOT,$doc_dir);
define(IMAGE_DOC_ROOT,$image_dir);
define(CONTROL_DOC_ROOT,$control_dir);

The outcome is that 

1.  I cannot submit pages using action=? echo CONTROL_DOC_ROOT
?verify_login.php
2.  I cannot use links as a href=? echo $DOC_HOME_ROOT ?click
here/a

Has anyone had a lot of use with define and in my scenario.  I don't the
problem is with the db results, I think it's more of the define().

Like I said above, I am using this on linux as well as windows.



==
Every chance I get, I try to incorporate 
Open Source resources into my everyday
work.  Maybe instead of of paying Microsoft
for software, the money can added to my
salary.
==



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



Re: [PHP-DB] Define()

2003-03-12 Thread Jim Hunter
The reason it doesn't work may go beyond PHP. You are trying to make an HREF
point to an exact location on your hard drive. When the user of your web
page clicks the link, they do not have that location on their system so it
will fail. Always use relative locations for links. Then once you get that
ironed out, skip the defines, just use the variables. Change the code to be:
 
$doc_dir = /store/;
$image_dir = /images/;
$control_dir = /control/;

?php echo $control_dir ?verify_login.php
a href=?php echo $doc_dir ?click here/a
 
and don't forget the 'php' after the ?
 
Jim Hunter
 
---Original Message---
 
From: [EMAIL PROTECTED]
Date: Wednesday, March 12, 2003 10:51:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Define()
 
I am developing an app which needs 3 constants. The value of these
constants comes from a database result.

This works fine. My problem is that they do not work very well. I am
developing on both windows/Linux (depending what I boot into).

This is the effect I want

$doc_dir = the string of d:/is/clients/client/web/store/
$image_dir = the string of d:/is/clients/client/web/images/
$control_dir = the string of d:/is/clients/client/web/control/ 

define(HOME_DOC_ROOT,$doc_dir);
define(IMAGE_DOC_ROOT,$image_dir);
define(CONTROL_DOC_ROOT,$control_dir);

The outcome is that 

1. I cannot submit pages using action=? echo CONTROL_DOC_ROOT
?verify_login.php
2. I cannot use links as a href=? echo $DOC_HOME_ROOT ?click
here/a

Has anyone had a lot of use with define and in my scenario. I don't the
problem is with the db results, I think it's more of the define().

Like I said above, I am using this on linux as well as windows.



==
Every chance I get, I try to incorporate 
Open Source resources into my everyday
work. Maybe instead of of paying Microsoft
for software, the money can added to my
salary.
==



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

. 

RE: [PHP-DB] Define()

2003-03-12 Thread Jonathan Villa
Jim,

Thanks for reply.

I haven't moved this into production yet, the d:/is/ was just for
testing as well as because when I use /client_name, the links do not
work.

I will to use the variable names instead of the define and see where
this gets me.

Just to note, I tried 

define(IMG_HOME_ROOT, /client_name/web/images/);

and it didn't work

What would be the difference between using that and

$img_dir = /client_name/web/images/;

 
--- Jonathan
 
 
 

-Original Message-
From: Jim Hunter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 12:58 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Define()

The reason it doesn't work may go beyond PHP. You are trying to make an
HREF
point to an exact location on your hard drive. When the user of your web
page clicks the link, they do not have that location on their system so
it
will fail. Always use relative locations for links. Then once you get
that
ironed out, skip the defines, just use the variables. Change the code to
be:

 

$doc_dir = /store/;

$image_dir = /images/;

$control_dir = /control/;



?php echo $control_dir ?verify_login.php

a href=?php echo $doc_dir ?click here/a

 

and don't forget the 'php' after the ?

 

Jim Hunter

 

---Original Message---

 

From: [EMAIL PROTECTED]

Date: Wednesday, March 12, 2003 10:51:04 AM

To: [EMAIL PROTECTED]

Subject: [PHP-DB] Define()

 

I am developing an app which needs 3 constants. The value of these

constants comes from a database result.



This works fine. My problem is that they do not work very well. I am

developing on both windows/Linux (depending what I boot into).



This is the effect I want



$doc_dir = the string of d:/is/clients/client/web/store/

$image_dir = the string of d:/is/clients/client/web/images/

$control_dir = the string of d:/is/clients/client/web/control/ 



define(HOME_DOC_ROOT,$doc_dir);

define(IMAGE_DOC_ROOT,$image_dir);

define(CONTROL_DOC_ROOT,$control_dir);



The outcome is that 



1. I cannot submit pages using action=? echo CONTROL_DOC_ROOT

?verify_login.php

2. I cannot use links as a href=? echo $DOC_HOME_ROOT ?click

here/a



Has anyone had a lot of use with define and in my scenario. I don't the

problem is with the db results, I think it's more of the define().



Like I said above, I am using this on linux as well as windows.







==

Every chance I get, I try to incorporate 

Open Source resources into my everyday

work. Maybe instead of of paying Microsoft

for software, the money can added to my

salary.

==







-- 

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] Re: Real Killer App!

2003-03-12 Thread Benjamin Walling
Are you doing some kind of recursion and getting stuck or overflowing the
stack?

If you create something like:

function Factorial($x)
{
 if ($x == 1)
 {
  return $x;
 }
 else
 {
  return $x * Factorial($x-1);
 }
}


You can get into a problem with overflowing the call stack with a
sufficiently high value for $x.

Nicholas Fitzgerald [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I'm having a heck of a time trying to write a little web crawler for my
 intranet. I've got everything functionally working it seems like, but
 there is a very strange problem I can't nail down. If I put in an entry
 and start the crawler it goes great through the first loop. It gets the
 url, gets the page info, puts it in the database, and then parses all of
 the links out and puts them raw into the database. On the second loop it
 picks up all the new stuff and does the same thing. By the time the
 second loop is completed I'll have just over 300 items in the database.
 On the third loop is where the problem starts. Once it gets into the
 third loop, it starts to slow down a lot. Then, after a while, if I'm
 running from the command line, it'll just go to a command prompt. If I'm
 running in a browser, it returns a document contains no data error.
 This is with php 4.3.1 on a win2000 server. Haven't tried it on a linux
 box yet, but I'd rather run it on the windows server since it's bigger
 and has plenty of cpu, memory, and raid space. It's almost like the
 thing is getting confused when it starts to get more than 300 entries in
 the database. Any ideas out there as to what would cause this kind of
 problem?

 Nick





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



[PHP-DB] Apache Problem

2003-03-12 Thread Alex Francis
Please bear with me, I am a complete newbie.

I am trying to use an in house server for test purposes and am having some
problems. I get an Internal Server error and when I look at the error log
the error is as follows:
Premature end of script headers: /apache/php/php.exe.

I have tried the Apache site, but can't find anything about it. Can someone
point me to where I may get help or information.



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



RE: [PHP-DB] Define()

2003-03-12 Thread Jonathan Villa
For starters, and in general, does anyone know why a view source would
not work in IE 6?  This hasn't worked for weeks, so I usually have to
use Mozilla to view the source.  
 
Anyway, Jim, this is my basic page setup.
 
?php
include_once(../common/store_config.php);
include_once(HOME_DOC_ROOT.common/header.php);
?
This is where my HTML codes goes.
So for example, a link to another page would look like this
a href=? echo DOC_HOME_ROOT ?stuff/index.phplink/a
 
a form would look like this
 
form action=? echo CTL_HOME_ROOT ? method=POST
/form
?php
include_once(HOME_DOC_ROOT.common/footer.php);
?
 
Note: within store_config.php I am declaring the constants along with
including some other files which I reference. For example, there is a
file called system_messages.php from which I pull system messages like
Item was added to your cart, Please enter in all the required
information, etc.
 
Currently I have the constant IMG_HOME_PATH set to
/killerspin/web/images/ and everything is fine.
 
For DOC_HOME_PATH I have /killerspin/web/store/ but I get all kinds of
errors like could not create stream.
 
Specifically
 
Here is the code.
 
?php
include_once(common/store_config.php);
include_once(DOC_HOME_PATH.common/header.php);
?
p class=contentThis is the index page./p
?php
include_once(DOC_HOME_PATH.common/footer.php);
?
 
 and here is the output
 
Warning: main(/killerspin/web/store/common/header.php) [function.main
http://www.php.net/function.main ]: failed to create stream: No such
file or directory in D:\is\clients\killerspin\web\store\index.php on
line 3
 
So I replace the code with this, 
 
include_once(/killerspin/web/store/common/header.php);
 
Same thing happens, but if I put
 
include_once(http://localhost/killerspin/web/store/common/header.php;);
then it's fine BUT the images don't show and I haven't changed a thing
on the for IMG_HOME_PATH!!
 
So in summary, maybe my question should have started with
 
How can I correctly use constants/variables to substitute for the
directory path so that I don't have to always include the entire path.
For example, in the event that my image directory changes or a directory
changes from login to register, then I don't want to have to go into
EVERY SINGLE  page and line of code to change it.
 
 
--- Jonathan
 
 
 


RE: [PHP-DB] Define()

2003-03-12 Thread Hutchins, Richard
Yes! I ran into this once and it stumped me for a while. You need to delete
the temporary internet files directory on the machine where you're viewing
the source. Took me three days of looking on microsoft.com to figure that
one out. 

I'm not proud.

 -Original Message-
 From: Jonathan Villa [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 3:21 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Define()
 
 
 For starters, and in general, does anyone know why a view source would
 not work in IE 6?  This hasn't worked for weeks, so I usually have to
 use Mozilla to view the source.  
  
 Anyway, Jim, this is my basic page setup.
  
 ?php
 include_once(../common/store_config.php);
 include_once(HOME_DOC_ROOT.common/header.php);
 ?
 This is where my HTML codes goes.
 So for example, a link to another page would look like this
 a href=? echo DOC_HOME_ROOT ?stuff/index.phplink/a
  
 a form would look like this
  
 form action=? echo CTL_HOME_ROOT ? method=POST
 /form
 ?php
 include_once(HOME_DOC_ROOT.common/footer.php);
 ?
  
 Note: within store_config.php I am declaring the constants along with
 including some other files which I reference. For example, there is a
 file called system_messages.php from which I pull system 
 messages like
 Item was added to your cart, Please enter in all the required
 information, etc.
  
 Currently I have the constant IMG_HOME_PATH set to
 /killerspin/web/images/ and everything is fine.
  
 For DOC_HOME_PATH I have /killerspin/web/store/ but I get all kinds of
 errors like could not create stream.
  
 Specifically
  
 Here is the code.
  
 ?php
 include_once(common/store_config.php);
 include_once(DOC_HOME_PATH.common/header.php);
 ?
 p class=contentThis is the index page./p
 ?php
 include_once(DOC_HOME_PATH.common/footer.php);
 ?
  
  and here is the output
  
 Warning: main(/killerspin/web/store/common/header.php) [function.main
 http://www.php.net/function.main ]: failed to create stream: No such
 file or directory in D:\is\clients\killerspin\web\store\index.php on
 line 3
  
 So I replace the code with this, 
  
 include_once(/killerspin/web/store/common/header.php);
  
 Same thing happens, but if I put
  
 include_once(http://localhost/killerspin/web/store/common/hea
 der.php);
 then it's fine BUT the images don't show and I haven't changed a thing
 on the for IMG_HOME_PATH!!
  
 So in summary, maybe my question should have started with
  
 How can I correctly use constants/variables to substitute for the
 directory path so that I don't have to always include the 
 entire path.
 For example, in the event that my image directory changes or 
 a directory
 changes from login to register, then I don't want to have to go into
 EVERY SINGLE  page and line of code to change it.
  
  
 --- Jonathan
  
  
  
 

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



RE: [PHP-DB] Define()

2003-03-12 Thread Hutchins, Richard
Let me amend that, you need to delete the FILES from the temporary internet
files directory, not the directory itself. Sorry.

 -Original Message-
 From: Hutchins, Richard [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 12, 2003 3:25 PM
 To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Define()
 
 
 Yes! I ran into this once and it stumped me for a while. You 
 need to delete
 the temporary internet files directory on the machine where 
 you're viewing
 the source. Took me three days of looking on microsoft.com to 
 figure that
 one out. 
 
 I'm not proud.
 
  -Original Message-
  From: Jonathan Villa [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, March 12, 2003 3:21 PM
  To: [EMAIL PROTECTED]
  Subject: RE: [PHP-DB] Define()
  
  
  For starters, and in general, does anyone know why a view 
 source would
  not work in IE 6?  This hasn't worked for weeks, so I 
 usually have to
  use Mozilla to view the source.  
   
  Anyway, Jim, this is my basic page setup.
   
  ?php
  include_once(../common/store_config.php);
  include_once(HOME_DOC_ROOT.common/header.php);
  ?
  This is where my HTML codes goes.
  So for example, a link to another page would look like this
  a href=? echo DOC_HOME_ROOT ?stuff/index.phplink/a
   
  a form would look like this
   
  form action=? echo CTL_HOME_ROOT ? method=POST
  /form
  ?php
  include_once(HOME_DOC_ROOT.common/footer.php);
  ?
   
  Note: within store_config.php I am declaring the constants 
 along with
  including some other files which I reference. For example, 
 there is a
  file called system_messages.php from which I pull system 
  messages like
  Item was added to your cart, Please enter in all the required
  information, etc.
   
  Currently I have the constant IMG_HOME_PATH set to
  /killerspin/web/images/ and everything is fine.
   
  For DOC_HOME_PATH I have /killerspin/web/store/ but I get 
 all kinds of
  errors like could not create stream.
   
  Specifically
   
  Here is the code.
   
  ?php
  include_once(common/store_config.php);
  include_once(DOC_HOME_PATH.common/header.php);
  ?
  p class=contentThis is the index page./p
  ?php
  include_once(DOC_HOME_PATH.common/footer.php);
  ?
   
   and here is the output
   
  Warning: main(/killerspin/web/store/common/header.php) 
 [function.main
  http://www.php.net/function.main ]: failed to create 
 stream: No such
  file or directory in D:\is\clients\killerspin\web\store\index.php on
  line 3
   
  So I replace the code with this, 
   
  include_once(/killerspin/web/store/common/header.php);
   
  Same thing happens, but if I put
   
  include_once(http://localhost/killerspin/web/store/common/hea
  der.php);
  then it's fine BUT the images don't show and I haven't 
 changed a thing
  on the for IMG_HOME_PATH!!
   
  So in summary, maybe my question should have started with
   
  How can I correctly use constants/variables to substitute for the
  directory path so that I don't have to always include the 
  entire path.
  For example, in the event that my image directory changes or 
  a directory
  changes from login to register, then I don't want to have to go into
  EVERY SINGLE  page and line of code to change it.
   
   
  --- Jonathan
   
   
   
  
 
 -- 
 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] Define()

2003-03-12 Thread Jonathan Villa
Jim, 
 
I don't think that matters.  One can escape into PHP in several ways
(depending on the php.ini config of course)
 
1.  ?php
2.  ?
3.  script language=php
4.  %
5.  ?= (to echo something right away)
 
Anyway, I tried that and it still doesn't work. 
 
--- Jonathan
 
 
 
-Original Message-
From: Jim Hunter [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 12, 2003 2:59 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Define()
 

Looking at your source you are still missing the php in the script. it
has to look like:
 
form action=?php echo CTL_HOME_ROOT ? method=POST
note the php |||
 
add this and try it again.
Jim

 


 
 
 
 
 
 
 


 
 
 
 


[PHP-DB] Cropped Text

2003-03-12 Thread Dallas Freeman
I dunno what it is called so that is why I am asking, so that I can
search the web about it.
What do you call the method of cropping text back, so that there are a
limited number of characters shown, the rest is cut off.

Thanking You,
Dallas Freeman
 




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



RE: [PHP-DB] Cropped Text

2003-03-12 Thread Aaron Wolski
Strlen

:

-Original Message-
From: Dallas Freeman [mailto:[EMAIL PROTECTED] 
Sent: March 12, 2003 4:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Cropped Text

I dunno what it is called so that is why I am asking, so that I can
search the web about it.
What do you call the method of cropping text back, so that there are a
limited number of characters shown, the rest is cut off.

Thanking You,
Dallas Freeman
 




-- 
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] Re: Cropped Text

2003-03-12 Thread Joel Colombo
i believe u mean the dictionary term. not PHP function.

Truncating

Joel


Dallas Freeman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I dunno what it is called so that is why I am asking, so that I can
 search the web about it.
 What do you call the method of cropping text back, so that there are a
 limited number of characters shown, the rest is cut off.

 Thanking You,
 Dallas Freeman







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



Re: [PHP-DB] Cropped Text

2003-03-12 Thread Micah Stevens
substr();

On Wed, 2003-03-12 at 13:21, Dallas Freeman wrote:

 I dunno what it is called so that is why I am asking, so that I can
 search the web about it.
 What do you call the method of cropping text back, so that there are a
 limited number of characters shown, the rest is cut off.
 
 Thanking You,
 Dallas Freeman
  
 
 
 


Re: [PHP-DB] Real Killer App!

2003-03-12 Thread Peter Beckman
Could it be that a certain web server sees you connect, you request a file,
and that file happens to take forever to load, leaving your script hanging
until memory runs out or something else?  Do you have timeouts set properly
to stop the HTTP GET/POST if nothing is happening on that connection?

Peter

On Tue, 11 Mar 2003, Nicholas Fitzgerald wrote:

 I'm having a heck of a time trying to write a little web crawler for my
 intranet. I've got everything functionally working it seems like, but
 there is a very strange problem I can't nail down. If I put in an entry
 and start the crawler it goes great through the first loop. It gets the
 url, gets the page info, puts it in the database, and then parses all of
 the links out and puts them raw into the database. On the second loop it
 picks up all the new stuff and does the same thing. By the time the
 second loop is completed I'll have just over 300 items in the database.
 On the third loop is where the problem starts. Once it gets into the
 third loop, it starts to slow down a lot. Then, after a while, if I'm
 running from the command line, it'll just go to a command prompt. If I'm
 running in a browser, it returns a document contains no data error.
 This is with php 4.3.1 on a win2000 server. Haven't tried it on a linux
 box yet, but I'd rather run it on the windows server since it's bigger
 and has plenty of cpu, memory, and raid space. It's almost like the
 thing is getting confused when it starts to get more than 300 entries in
 the database. Any ideas out there as to what would cause this kind of
 problem?

 Nick



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


---
Peter Beckman  Internet Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---

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



[PHP-DB] ODBC Query max()

2003-03-12 Thread Squirrel User
I'm trying to extract one record that has largest sequence ID number for an 
employee, so I've tried below but doesn't work.  Help.

$mQuery = EmployeeID = '$user';
$mCur = odbc_exec( $mCnx, select ID=max(ID),Date,TimeIn,TimeOut,StationIP 
from Clocks where $mQuery );


-
This mail sent through ISOT.  To find out more 
about ISOT, visit http://isot.com

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



Re: [PHP-DB] Real Killer App!

2003-03-12 Thread Nicholas Fitzgerald
Ok, I thought the index bit might be the problem since when I went to 
look I realized I hadn't created one for this database. I also noticed a 
problem with my raid array so I updated the driver and that went away. 
Still, no matter what, I get this same problem.  So here you go. Below 
is that entire prog as it now exists. Notice I have NOT configured it as 
yet to into the next level. I did this on purpose so I wouldn't have to 
kill it in the middle of operation and potencially scew stuff up. They 
way it is now, it looks at all the records in the database, updates them 
if necessary, then extracts all the links and puts them into the 
database for crawling on the next run through. Once I get this working 
I'll put a big loop in it so it keeps going until there's nothing left 
to look at. Meanwhile, if anyone sees anything in here that could be the 
cause of this problem please let me know!

?php
require('../includes/config.inc');
global $robots, $keywords, $description, $title, $body, $url, $spiderday;
set_time_limit(0);
echo # The Spider is Running, Do Not Close This Console #\n\n;

// Open the database and start looking at URLs
$sql = mysql_query(SELECT * FROM search);
while($rslt = mysql_fetch_array($sql)){
   $url = $rslt[url];
// Open URL for parsing
   $open = @fopen($url, r);
   if($open){
   $read = fread($open, 10);
   fclose($open);
   }
   else{
   $kill = mysql_query(DELETE FROM search WHERE url='$url');
   continue;
   }
// Set date and checksum info
   $today = date(Y-m-d);
   $checksum = crc32($read);
   $chkyr = strftime(date(Y));
   $chkmo = strftime(date(m));
   $chkdy = strftime(date(d));
   $daycheck = strftime(%Y-%m-%d, 
mktime(0,0,0,$chkmo,-$spiderday,$chkyr));

// Get meta tags and use get_meta_tags to check if the file is actually 
there
   $meta = @get_meta_tags($url);
   if(!$meta){
   $kill = mysql_query(DELETE FROM search WHERE url='$url');
   continue;
   }
   $robots = $meta[robots];
   $keywords = $meta[keywords];
   $description = $meta[description];

// Get the page title
   $temp = stristr($read,title);
   $tpos = strlen($read) - strlen($temp);
   $temp = stristr($read,/title);
   $tend = strlen($read) - strlen($temp);
   $tchn = ($tend - $tpos);
   $title = strip_tags(substr($read, ($tpos+7),$tchn));
// Get the page body
   $body = str_replace(',`,trim(strip_tags($read)));
// Put the stuff in the search database
   $puts = mysql_query(SELECT * FROM search WHERE url='$url');
   $site = mysql_fetch_array($puts);
   $nurl = $site[url];
   $ncrc = $site[checksum];
   $ndate = $site[date];
   if($ndate = $daycheck || $ncrc != $checksum){
   echo \n\nUpdating: $title\n$url\n;
   $renew = mysql_query(UPDATE search SET url='$url', 
title='$title', metak='$keywords', metad='$description', 
mrobot='$robots', body='$body', checksum='$checksum', date=CURDATE() 
WHERE url='$url');
   }
   else{
   continue;
   }

// Parse the main URL
   $top = parse_url($url);
   $tschm = $top[scheme];
   $thost = $top[host];
   $tpath = $top[path];
   $tqury = $top[query];
   $tfrag = $top[fragment];
// Parse all the links on the page
   $rtemp = stristr($read,href);   
   $temp = stristr($rtemp,);
   while($rtemp){
   // Parse the href out of the string
   $rtemp = stristr($temp,href);   
   $lpos = strlen($rtemp) - strlen($temp);
   $temp = stristr($rtemp,);
   $lend = strlen($rtemp) - strlen($temp);
   $alink = str_replace('', ,strip_tags(trim(substr($rtemp, 6, 
($lend);
   $blink = stristr($alink, );
   $alen = strlen($alink) - strlen($blink);
   $link = substr($alink, 0, $alen);

   // Kill any trailing slashes
   if(substr($link,(strlen($link)-1)) == /){
   $link = substr($link,0,(strlen($link)-1));
   }
   // Get rid of any garbage and most binary files in the link
   if(substr_count($link,?) != 0){
   continue;
   }
   if(substr_count($link,@) != 0){
   continue;
   }
   if(substr_count($link,javascript) != 0){
   continue;
   }
   if(substr_count($link,mailto) != 0){
   continue;
   }
  
   if(substr_count($link,jpg) != 0){
   continue;
   }
  
   if(substr_count($link,gif) != 0){
   continue;
   }

   if(substr_count($link,pdf) != 0){
   continue;
   }
   if(substr_count($link,pnf) != 0){
   continue;
   }
   if(substr_count($link,mpg) != 0){
   continue;
   }
   if(substr_count($link,mpeg) != 0){
   continue;
   }
   if(substr_count($link,av) != 0){
   continue;
   }
   // Parse the current link
   $bot = @parse_url($link);
   if(!$bot){
   continue;
   }
   $bschm = $bot[scheme];
   $bhost = $bot[host];
   $bpath = $bot[path];
   $bqury = $bot[query];
   $bfrag = $bot[fragment];
   // Get rid of outside links
   if($bhost !=   $bhost != $thost){
   

[PHP-DB] listbox not adding data to mySql?

2003-03-12 Thread Billy
Im having a problem getting listbox data to go into a mySql database.

This may be a simple problem but Ive been searching with out any result, and
thought I would ask on here.

Here goes...

 select name=server
  option value=NoNo/option
  option value=YesYes/option
 /select

the name of the field in the database is server, all of the other inputs
that I have within the page work and enter data but when I try using
listbox's it doesnt seem to work.

Cheers if any one can help me with this

Rujlon


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



[PHP-DB] PHP script execution - display issue

2003-03-12 Thread Petre NICOARA
Hello,
I have a display problem with one of my sites.
Because there is an big amount of information in the pages, which is
extracted from database, using IE browser I see only the background of
the site, and then, after a time, the whole page. 
My client has recently requested to make something to improve the site
speed and display time. 
So because all the site is done using the classes, and the information
is extracted through them, I reduced the instruction numbers, and I
compacted as much as I could the classes. But I still have the display
problem using IE browser : I see the background, and just after that I
see the whole site.
I mention that the classes are included, and the class function is
called through $this_class-function($parameters); Not all the classes
used in the page are called In the beginning; and another mention is
that the site pages contains 4 sections. Top, left, middle,  right.
 
My question is:
Is there a way to display sequentially the site. After the background,
to display the first section (top), then left part, middle part and
right part after that ?
Again, the site loads like this : the background, then the whole page.
This doesn't matter if I use dial-up or T1. 
My client saw, for example, that cnn or yahoo site loads sequentially.
Knowing that yahoo is done in php, I'm wondering how they did it.
 
Thanks
Petre Nicoara
 


[PHP-DB] textarea data and printing

2003-03-12 Thread Rajesh Fowkar
Hi,

We are accepting Detailed description of the item in
Textarea/Textarea.

Is there any function which can return full words without breaking the
lines. The data is stored in a PostgreSQL database in varchar field.

item_detail_description varchar(200)

I am assuming that the user need not press the 'enter' key at the end of
each line. Hence by using the 'carriage return' code this function
cannot be written. I was interested in knowing if any such function
already exists.

Thanks in advance.

Peace

--
Rajesh
:
[ GNU/Linux One Stanza Tip (LOST) ]###

Sub : Locating a command (whereis)   LOST #126

To locate the  binary, source, and  manual page for a command,
try : whereis command [e.g. whereis man].  See man pages for
detailed filter options) 
For merely knowing where it lies: which command

[EMAIL PROTECTED]##
:

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



Re: [PHP-DB] How to Connect remote DB server?

2003-03-12 Thread Patrick LOK
There is no firewall within the LAN environment.

I tried the mssql_connect too using mssql_connect(testdb,sa,) but same
error returned!
Any idea?

./pl

Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Wednesday 12 March 2003 19:28, Patrick LOK wrote:
  It is possible to connect a remote db server using x_connect?
  e.g. a PostgreSQL in server PSQLDB, ip=192.168.0.100  and a MSSQL server
  MSSQLDB, ip=192.168.0.110
 
  I tried pgsql_connect(psqldb,administrator,) 
  pgsql_connect(192.168.0.100,administrator,) but failed!
 
  Error is Unable to connect to server: psqldb in psqltest.php on line 2

  Unable to connect to server: 192.168.0.100 in psqltest.php on line 2

 Yes, it is possible to connect to a remote DB server. You have to make
sure
 that:

 a) the DB server in question is configured to accept remote connections
 b) any intervening firewall is correctly configured to allow DB traffic


 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-db
 --
 /*
 Dr. Livingston?
 Dr. Livingston I. Presume?
 */




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



[PHP-DB] Re: [PHP] Re: [PHP-DB] How to Connect remote DB server?

2003-03-12 Thread Patrick LOK
Couldn't be !  I have MS client connecting to the db-server!  I tried
odbc_connect for both MSSQL  PostgreSQL and it is ok!
However, odbc connection is no good for db processing!

Further help?

./pl


Niklas lampén [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Possibly the db-server is accepting only localhost connections.


Niklas


-Original Message-
From: Patrick LOK [mailto:[EMAIL PROTECTED]
Sent: 12. maaliskuuta 2003 14:39
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP] Re: [PHP-DB] How to Connect remote DB server?


There is no firewall within the LAN environment.

I tried the mssql_connect too using mssql_connect(testdb,sa,) but same
error returned! Any idea?

./pl

Jason Wong [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Wednesday 12 March 2003 19:28, Patrick LOK wrote:
  It is possible to connect a remote db server using x_connect?
  e.g. a PostgreSQL in server PSQLDB, ip=192.168.0.100  and a MSSQL
  server MSSQLDB, ip=192.168.0.110
 
  I tried pgsql_connect(psqldb,administrator,) 
  pgsql_connect(192.168.0.100,administrator,) but failed!
 
  Error is Unable to connect to server: psqldb in psqltest.php on
  line 2

  Unable to connect to server: 192.168.0.100 in psqltest.php on line
  2

 Yes, it is possible to connect to a remote DB server. You have to make
sure
 that:

 a) the DB server in question is configured to accept remote
 connections
 b) any intervening firewall is correctly configured to allow DB traffic


 --
 Jason Wong - Gremlins Associates - www.gremlins.biz
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development
 *
 --
 Search the list archives before you post
 http://marc.theaimsgroup.com/?l=php-db
 --
 /*
 Dr. Livingston?
 Dr. Livingston I. Presume?
 */




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

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail. For
more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/



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



Re: [PHP-DB] How to Connect remote DB server?

2003-03-12 Thread Mark
A couple of things. First, I believe it's pg_connect(), not
pgsql_connect(). Also, note that according to the docs, the old
syntax with multiple parameters 
$conn = pg_connect(host, port, options, tty, dbname) 
has been deprecated.

But more importantly, can you ping the postgres/mssql server from the
web server? Can you connect to them via the command line or via ODBC?
Try to narrow it down to the network, PHP, or your code.


--- Patrick LOK [EMAIL PROTECTED] wrote:
 There is no firewall within the LAN environment.
 
 I tried the mssql_connect too using mssql_connect(testdb,sa,)
 but same
 error returned!
 Any idea?
 
 ./pl
 
 Jason Wong [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  On Wednesday 12 March 2003 19:28, Patrick LOK wrote:
   It is possible to connect a remote db server using
 x_connect?
   e.g. a PostgreSQL in server PSQLDB, ip=192.168.0.100  and a
 MSSQL server
   MSSQLDB, ip=192.168.0.110
  
   I tried pgsql_connect(psqldb,administrator,) 
   pgsql_connect(192.168.0.100,administrator,) but failed!
  
   Error is Unable to connect to server: psqldb in psqltest.php
 on line 2
 
   Unable to connect to server: 192.168.0.100 in psqltest.php on
 line 2
 
  Yes, it is possible to connect to a remote DB server. You have to
 make
 sure
  that:
 
  a) the DB server in question is configured to accept remote
 connections
  b) any intervening firewall is correctly configured to allow DB
 traffic
 
 
  --
  Jason Wong - Gremlins Associates - www.gremlins.biz
  Open Source Software Systems Integrators
  * Web Design  Hosting * Internet  Intranet Applications
 Development *
  --
  Search the list archives before you post
  http://marc.theaimsgroup.com/?l=php-db
  --
  /*
  Dr. Livingston?
  Dr. Livingston I. Presume?
  */
 
 
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

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



[PHP-DB] Cannot execute php applications. Problems with required library mysql.so

2003-03-12 Thread Mathieu Dumoulin
Got this problem here.

I have a script i wish to run from a crontab every 2 minutes (Compiles live
stats for a hockey site). This script doesn't run at all in shell mode as an
application but works perfectly fine when called from the web.

Problem is i can't integrate it in the web site like when someone adds an
event or they have to wait like 30 seconds before being able to enter
something else. Talk about live stats if you can only enter 1
shot/hit/faceoff/etc each 30 seconds..

So i HAVE, unless there is a way to do it another way, to run it as a
crontab. My question now is:

- Can i, from a php script from the web start running another script
directly and ignoring the reply...just make it run, thats all and then
redirect the user to some other page while it runs
- Or, can you help me solve my problem about unloadable libraries:

Here is what i can tell from the error i got:
===
[EMAIL PROTECTED] cron_compile_sys]# ./compileMatches.php
Zend Optimizer requires Zend Engine API version 20020429
The installed Zend Engine API version is 20001224

Content-type: text/html

PHP Warning:  Unable to load dynamic library '/usr/lib/php4/mysql.so' -
libmysqlclient.so.10: cannot open shared object file: No such file or
directory in Unknown on line 0
X-Powered-By: PHP/4.0.6
Content-type: text/html

br
bFatal error/b:  Call to undefined function:  mysql_connect() in
b/var/www/sandbox.lhjmq.xl5.net/web/classes/class.mysql.connection.php/b
on line b53/bbr
===
I check my /usr/lib/php4/ folder and it DOES contain the mysql.so file
Second, i looked all over the machine to find other PHP interpretors, i
found several ones all saying version 4.0.6 although when i run phpinfo.php
it says php4.2.2 in the phpinfo response.

http://www.lhjmq.qc.ca/phpinfo.php

Finaly, since it's a production web server, i cannot take the risk to
recompile apache, php or install a new module unless i get an approval from
the website owner, so please, if possible try not to give me that as a
solution. ohh, another thing. When i directly run the interpreter it says
this:
===
[EMAIL PROTECTED] /]# cd /usr
[EMAIL PROTECTED] usr]# cd bin
[EMAIL PROTECTED] bin]# php
Content-type: text/html

PHP Warning:  imap: Unable to initialize module
Module compiled with module API=20001222, debug=0, thread-safety=0
PHPcompiled with module API=20020429, debug=0, thread-safety=0
These options need to match
 in Unknown on line 0
PHP Warning:  ldap: Unable to initialize module
Module compiled with module API=20001222, debug=0, thread-safety=0
PHPcompiled with module API=20020429, debug=0, thread-safety=0
These options need to match
 in Unknown on line 0
PHP Warning:  Unable to load dynamic library '/usr/lib/php4/mysql.so' -
libmysqlclient.so.10: cannot open shared object file: No such file or
directory in Unknown on line 0
===
Please oh please, help me out on this

Mathieu Dumoulin
Programmer analyst for web solutions
www.groupimage.com




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



[PHP-DB] Re: [PHP] Cannot execute php applications. Problems with required library mysql.so

2003-03-12 Thread Richard Sumilang
Well for starters, you shouldn't be running a repetitive process from
the web each time, thats why they have cron jobs. In order to have cron
jobs execute php code as an executable, you must make sure you have php
compiled as a cgi. It seems on your error message also that you don't
have php compiled with mysql, you might want to do that also. When
compiling, use ./configure -with-mysql, that should do it for MySQL.
On Wednesday, March 12, 2003, at 08:24  PM, Mathieu Dumoulin wrote:

Got this problem here.

I have a script i wish to run from a crontab every 2 minutes (Compiles  
live
stats for a hockey site). This script doesn't run at all in shell mode  
as an
application but works perfectly fine when called from the web.

Problem is i can't integrate it in the web site like when someone adds  
an
event or they have to wait like 30 seconds before being able to enter
something else. Talk about live stats if you can only enter 1
shot/hit/faceoff/etc each 30 seconds..

So i HAVE, unless there is a way to do it another way, to run it as a
crontab. My question now is:
- Can i, from a php script from the web start running another script
directly and ignoring the reply...just make it run, thats all and then
redirect the user to some other page while it runs
- Or, can you help me solve my problem about unloadable libraries:
Here is what i can tell from the error i got:
===
[EMAIL PROTECTED] cron_compile_sys]# ./compileMatches.php
Zend Optimizer requires Zend Engine API version 20020429
The installed Zend Engine API version is 20001224
Content-type: text/html

PHP Warning:  Unable to load dynamic library '/usr/lib/php4/mysql.so' -
libmysqlclient.so.10: cannot open shared object file: No such file or
directory in Unknown on line 0
X-Powered-By: PHP/4.0.6
Content-type: text/html
br
bFatal error/b:  Call to undefined function:  mysql_connect() in
b/var/www/sandbox.lhjmq.xl5.net/web/classes/ 
class.mysql.connection.php/b
on line b53/bbr
===
I check my /usr/lib/php4/ folder and it DOES contain the mysql.so file
Second, i looked all over the machine to find other PHP interpretors, i
found several ones all saying version 4.0.6 although when i run  
phpinfo.php
it says php4.2.2 in the phpinfo response.

http://www.lhjmq.qc.ca/phpinfo.php

Finaly, since it's a production web server, i cannot take the risk to
recompile apache, php or install a new module unless i get an approval  
from
the website owner, so please, if possible try not to give me that as a
solution. ohh, another thing. When i directly run the interpreter it  
says
this:
===
[EMAIL PROTECTED] /]# cd /usr
[EMAIL PROTECTED] usr]# cd bin
[EMAIL PROTECTED] bin]# php
Content-type: text/html

PHP Warning:  imap: Unable to initialize module
Module compiled with module API=20001222, debug=0, thread-safety=0
PHPcompiled with module API=20020429, debug=0, thread-safety=0
These options need to match
 in Unknown on line 0
PHP Warning:  ldap: Unable to initialize module
Module compiled with module API=20001222, debug=0, thread-safety=0
PHPcompiled with module API=20020429, debug=0, thread-safety=0
These options need to match
 in Unknown on line 0
PHP Warning:  Unable to load dynamic library '/usr/lib/php4/mysql.so' -
libmysqlclient.so.10: cannot open shared object file: No such file or
directory in Unknown on line 0
===
Please oh please, help me out on this
Mathieu Dumoulin
Programmer analyst for web solutions
www.groupimage.com


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



Richard Sumilang
IT Manager
ExexDirect, LLC
21650 Oxnard St., Suite 2350
Woodland Hills, CA 91367
(877) 591-3252
[EMAIL PROTECTED]
www.exexdirect.com
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] setup connection to sybase

2003-03-12 Thread P Lok
Cannot setup connection to remote Sybase db.
Using Apache 1.3.x + PHP 4.x on Windows 2000 server.
Remote Sybase db on Windows 2000 server.

PHP manual says Servername in sybase_connect() defines in 'interfaces' file.
What are they?  Where are they?

rgds



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



[PHP-DB] How to Connect remote DB server?

2003-03-12 Thread Patrick LOK
It is possible to connect a remote db server using x_connect? 
e.g. a PostgreSQL in server PSQLDB, ip=192.168.0.100  and a MSSQL server MSSQLDB, 
ip=192.168.0.110

I tried pgsql_connect(psqldb,administrator,)  
pgsql_connect(192.168.0.100,administrator,) but failed!

Error is Unable to connect to server: psqldb in psqltest.php on line 2  Unable to 
connect to server: 192.168.0.100 in psqltest.php on line 2

Can anyone help?

regards
./pl