Re: [PHP-DB] Real Killer App!

2003-03-13 Thread Nicholas Fitzgerald
As you guys know I've been going around in circles with this spider app 
problem for a couple days. I think I finally found where the screwup is, 
and I'm sure you'll be interested to hear about it. I had been testing 
with three sites because they were fairly diverse and gave me a lot of 
different stuff  to stress the app. One was a site with about 70 pages 
made up almost entirely of links that include a query string. The other 
two where sites mostly of just text with lots of link lists and stuff, 
and that used a lot of SSI, and stuff like that. These two sites had 
about 1000 pages or so each, but only indexed about 200 or so of them 
then died. I decided to try something different.

I indexed a site that I have on my server. Since it's hitting it at 
100MHz things went pretty fast. It ran for a while and indexed over 1600 
pages. Then, not only did it die, I got BSOD! Yep, that's right, w2k 
handed me a hard ntoskernel crash. Isn't that special? At this point I'm 
not sure if it's a bug in windows, in php 4.3.1, or mysql 3.23.55. In 
any case, I'm moving the app to a linux box tomorrow and will be very 
interested to see the results of that. It's a standard red hat 8 setup, 
php4.2.2 and mysql 3.23.54a. I hate to have to release this as a linux 
only release, but if that's what it takes, that's what it takes!

In the mean time, is there anything in php or mysql that is critical for 
windows that might not be addressed in the standard docs? The hardware 
is good, and not anywhere near being taxed. The OS seems stable, I 
haven't had a lot of trouble with w2k when asking it to do much more 
complex stuff than this. Anyway, if this doesn't work on the linux box, 
I'm going to have to start from scratch on this spider. How would you do it?

Nick



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


Re: [PHP-DB] Syncing the structure of two databases?

2003-03-13 Thread John Gray
it's not PHP, but mysqldiff is a perl tool that would probably give you
the desired results. it can generate the SQL necessary to sync
databases. 

http://adamspiers.org/computing/mysqldiff/

(sorry if anyone got this in duplicate, i was having probs sending to
the list until i fixed the envelope.)

- john

On Thu, Mar 13, 2003 at 09:16:51PM -0500, John W. Holmes <[EMAIL PROTECTED]> wrote:
> > I'm developing an intranet-based application using PHP and MySQL. We
> > release new versions of our application regularly, and synchronizing
> the
> > structure of the databases is beginning to be a headache.
> > 
> > Do any tools exist that would let me sync the structure of two
> > databases? Ideally, I'd like to include a "mysqldump --no-data" (or
> > something analogous) file with each of our releases, and run a script
> on
> > the client's server that would update the structure of their own local
> > database from that file.
> > 
> > We're cross-platform (windows, linux, and mac). And, all servers are
> > behind their own firewalls.
> > 
> > I'm aware of sqlyog (http://www.webyog.com/sqlyog/download.html), but
> I
> > need something that can be written in php, and works without a "live"
> > connection to the "master" database.
> 
> I don't know of any automatic way to do it. It wouldn't be too hard to
> write a little PHP script that gets the difference between two mysqldump
> files and generates the appropriate ALTER and INSERT queries to bring
> the old database up to date. An exec call do diff might even make it
> easier (I don't know anything about diff, but I'm guessing it could
> help.) Actually, now that I think a little more about it, it would be a
> little hard, but not impossible. :)
> 
> ---John W. Holmes...
> 
> PHP Architect - A monthly magazine for PHP Professionals. Get your copy
> today. http://www.phparch.com/

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



RE: [PHP-DB] Table name is variable

2003-03-13 Thread John W. Holmes
> I am a begginer in PHP programming and I would appreciate any help.
> 
> My problem is the following: I need to make the name of my table a
> variable.
> My thought was simple:
> 
> $imprimir = mysql_query("SELECT id, data FROM $tabela",$db);
> 
> but it doesnt work... how should i do it?

Just like that. Make sure $tabela has a value.

---John W. Holmes...

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



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



[PHP-DB] Table name is variable

2003-03-13 Thread Dani Matielo
Hello.

I am a begginer in PHP programming and I would appreciate any help.

My problem is the following: I need to make the name of my table a variable.
My thought was simple:

$imprimir = mysql_query("SELECT id, data FROM $tabela",$db);


but it doesnt work... how should i do it?

Thank you in advance,

Dani



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



RE: [PHP-DB] Connect Microsoft SQL database with php on unix

2003-03-13 Thread John W. Holmes
> I would like to know the best way to connect to SQL database(which
located
> on Microsoft SQL Server) from PHP(Located on Unix Server).

Maybe mssql_connect()??

www.php.net/mssql_connect

---John W. Holmes...

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



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



[PHP-DB] Connect Microsoft SQL database with php on unix

2003-03-13 Thread Arbel Haskel
Hello

I would like to know the best way to connect to SQL database(which located
on Microsoft SQL Server) from PHP(Located on Unix Server).

Thanks



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



RE: [PHP-DB] Syncing the structure of two databases?

2003-03-13 Thread John W. Holmes
> I'm developing an intranet-based application using PHP and MySQL. We
> release new versions of our application regularly, and synchronizing
the
> structure of the databases is beginning to be a headache.
> 
> Do any tools exist that would let me sync the structure of two
> databases? Ideally, I'd like to include a "mysqldump --no-data" (or
> something analogous) file with each of our releases, and run a script
on
> the client's server that would update the structure of their own local
> database from that file.
> 
> We're cross-platform (windows, linux, and mac). And, all servers are
> behind their own firewalls.
> 
> I'm aware of sqlyog (http://www.webyog.com/sqlyog/download.html), but
I
> need something that can be written in php, and works without a "live"
> connection to the "master" database.

I don't know of any automatic way to do it. It wouldn't be too hard to
write a little PHP script that gets the difference between two mysqldump
files and generates the appropriate ALTER and INSERT queries to bring
the old database up to date. An exec call do diff might even make it
easier (I don't know anything about diff, but I'm guessing it could
help.) Actually, now that I think a little more about it, it would be a
little hard, but not impossible. :)

---John W. Holmes...

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



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



[PHP-DB] Syncing the structure of two databases?

2003-03-13 Thread matt rowe
Dear list,
I'm developing an intranet-based application using PHP and MySQL. We
release new versions of our application regularly, and synchronizing the
structure of the databases is beginning to be a headache.
Do any tools exist that would let me sync the structure of two
databases? Ideally, I'd like to include a "mysqldump --no-data" (or
something analogous) file with each of our releases, and run a script on
the client's server that would update the structure of their own local
database from that file.
We're cross-platform (windows, linux, and mac). And, all servers are
behind their own firewalls.
I'm aware of sqlyog (http://www.webyog.com/sqlyog/download.html), but I
need something that can be written in php, and works without a "live"
connection to the "master" database.
Any clues?

Thanks,
Matt


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


RE: [PHP-DB] timestamp problem

2003-03-13 Thread John W. Holmes
> I'm using the timestamp column type in a database, and the only
problem
> is that it the stamp is three hours prior to the actual post when I
post
> to a remote server.  I'm assuming, since it works fine on my machine,
> that this is because the remote server I am is in a different time
> zone.  Is there any way I can amend my code to account for the time
> difference?

So adjust it. Either add 3 hours to any time you add to the database or
when you pull the time from the database... You can use mktime() in PHP
or DATE_ADD() in (assuming) MySQL. 

---John W. Holmes...

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



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



[PHP-DB] How to connect to Microsoft SQL DB

2003-03-13 Thread Uri Gal
Hello Everybody,

Can anyone send me a code snippet to connect to Microsoft SQL server?
I only worked with MySQL until now and need to reed info from a SQL server.

Please specify also if I need to install anything to be able to connect.

Thank you,

Uri



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



[PHP-DB] Vars and Includes

2003-03-13 Thread Nicholas Fitzgerald
Well, here's one for you. I put the spider thing down for a while and 
went to work on another part of the app. Immediately, and all I did was 
change a particular value from a hard "3" to a variable set to "3". Now, 
even after putting the code back exactly the way it was, and even after 
rebooting the server, php will not execute any includes. None at all, 
not even my "require(configfile)" type include. What the heck just 
happened? Now none of my php sites are executing includes at all!

Nick



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


[PHP-DB] ODBC problem

2003-03-13 Thread Kiswa
Hi.
I have a problem, Been writing a site in php that uses ODBC systemlink to a
Access DB
The server is apache

The problem is that the final server is win2000 IIS and the thing doesent
work.
It seems that the odbc connect doesent output any info.
It works fine on apache
cant figure out what the difference is.




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



RE: [PHP-DB] PHP and Sendmail

2003-03-13 Thread Gavin Amm
Chris,

Just a thought.
You could set up a linux system on an old pentium box & just use it as
your mail server, thus no need to change your code if it is hard coded,
just point to the new server.

Gav



-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED] 
Sent: Friday, 14 March 2003 8:13 AM
To: php
Subject: [PHP-DB] PHP and Sendmail


Hi there everyone,

I might soon be moving my server from Linux to Windows, and I was
wondering if I will have to rewrite my PHP - Sendmail code to work on
Windows Apache?  Or is there a better system than sendmail for PHP on
Windows?

Oh BTW it has to support HTML.

Please help. if I do have to rewrite my form code it will take weeks LOL
:-)

Thanks

Chris

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



Re: [PHP-DB] PHP and Sendmail

2003-03-13 Thread Chris Payne
Hi there,

I have an SMTP server on here (Imail) - how would I use it with PHP?  Any
tips to send a quick email as a test?

Thank you :-)

Chris

> You have two options. First option is to get sendmail for windows.
> You're going to pay for this, but there is a sendmail replacement for
> windows out there that most people don't know about. I've used it and
> it's really excellent. The only think you would have to change is the
> location of sendmail in your php.ini. You can find it at
> http://www.indigostar.com. It'll cost you about $50, but it's well worth
> it if you need sendmail functionality in windows. Of course, with PHP
> your best bet is to just use the built in SMTP support that comes with
> it. As long as you have access to an SMTP server you don't need
> sendmail. I use both, but I only use the sendmail app with perl apps and
> stuff like that, I just have PHP send stuff straight to the SMTP server.
>
> Nick
>
> Chris Payne wrote:
>
> >Hi there everyone,
> >
> >I might soon be moving my server from Linux to Windows, and I was
wondering if I will have to rewrite my PHP - Sendmail code to work on
Windows Apache?  Or is there a better system than sendmail for PHP on
Windows?
> >
> >Oh BTW it has to support HTML.
> >
> >Please help. if I do have to rewrite my form code it will take weeks LOL
:-)
> >
> >Thanks
> >
> >Chris
> >
> >
>
>
>
>
> --
> 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] interbase/firebird - There was a time with multiple conections

2003-03-13 Thread Mauricio Junqueira
Hello,
I have been using php --with-interbase for some time
and I enjoy using php scripts to everything so I did
some small scripts to use as a datapump to the interbase.
My scripts relay on the fact that I can have two
simultaneos connections to the different databases
in order to pump data from one to another.
Since I allways update my CGI version of php e also
I am using the latest stable version of firebird, I
believe that something has happend that changed the
behavior of my php scrips.
Now, when I do the second connection, everything looks
like the second one takes command over the first one.
I could verify this with some changes in my script.

Does anyone knows about such behavior?

I may post my script if anyone is interested,
but there is nothing really special about it besides
two connections to the interbase.
By the way, I am using persistent connections.
Thank you!



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


Re: [PHP-DB] PHP and Sendmail

2003-03-13 Thread Nicholas Fitzgerald
You have two options. First option is to get sendmail for windows. 
You're going to pay for this, but there is a sendmail replacement for 
windows out there that most people don't know about. I've used it and 
it's really excellent. The only think you would have to change is the 
location of sendmail in your php.ini. You can find it at 
http://www.indigostar.com. It'll cost you about $50, but it's well worth 
it if you need sendmail functionality in windows. Of course, with PHP 
your best bet is to just use the built in SMTP support that comes with 
it. As long as you have access to an SMTP server you don't need 
sendmail. I use both, but I only use the sendmail app with perl apps and 
stuff like that, I just have PHP send stuff straight to the SMTP server.

Nick

Chris Payne wrote:

Hi there everyone,

I might soon be moving my server from Linux to Windows, and I was wondering if I will have to rewrite my PHP - Sendmail code to work on Windows Apache?  Or is there a better system than sendmail for PHP on Windows?

Oh BTW it has to support HTML.

Please help. if I do have to rewrite my form code it will take weeks LOL :-)

Thanks

Chris
 





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


[PHP-DB] PHP and Sendmail

2003-03-13 Thread Chris Payne
Hi there everyone,

I might soon be moving my server from Linux to Windows, and I was wondering if I will 
have to rewrite my PHP - Sendmail code to work on Windows Apache?  Or is there a 
better system than sendmail for PHP on Windows?

Oh BTW it has to support HTML.

Please help. if I do have to rewrite my form code it will take weeks LOL :-)

Thanks

Chris

[PHP-DB] Oracle 8?

2003-03-13 Thread heilo
Hi there everybody!

I'm running Win2000 an Oracle 8 server and PHP. Now - just a simple
question: does anybody know any good FAQs or resources/references for
specally this topic??

Thx a lot - .ma


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



RE: [PHP-DB] Help with Parse error

2003-03-13 Thread Neil Lathwood
Michelle Whelan wrote:
> Does someone know why I am getting this error?  $Yards =
> $_POST["needdirtype"] is line 45
> 
> Parse error: parse error in /havedirt2.php on line 45

You seem to be missing the ; from each line.

Neil

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



[PHP-DB] Help with Parse error

2003-03-13 Thread Michelle Whelan

Does someone know why I am getting this error?  $Yards = $_POST["needdirtype"] is line 
45

Parse error: parse error in /havedirt2.php on line 45

$DirtType = $_POST["needdirtype"]
$Yards = $_POST["noyards"] 
$Contact = $_POST["contactname"]
$Area = $_POST["areacode"]
$Prefix = $_POST["prefix"]
$Suffix = $_POST["suffix"]
$Zip = $_POST["zipcode"]
$Expdate = $_POST["expdate"]
$Email = $_POST["email"]
$Jcity = $_POST["jobcity"]
$XStreets = $_POST["xstreets"]

$query = "INSERT INTO $table (needdirtype, noyards, contactname, areacode, prefix, 
suffix, zipcode, expdate, email, jobcity, xstreets)  
VALUES('$DirtType','$Yards','$Contact','$Area','$Prefix','$Suffix','$Zip','$Expdate', 
'$Email','$Jcity','$XStreets')"; 

$result = mysql_query($query); 



[PHP-DB] timestamp problem

2003-03-13 Thread drparker
I'm using the timestamp column type in a database, and the only problem
is that it the stamp is three hours prior to the actual post when I post
to a remote server.  I'm assuming, since it works fine on my machine,
that this is because the remote server I am is in a different time
zone.  Is there any way I can amend my code to account for the time
difference?


-- 
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-13 Thread Nicholas Fitzgerald
Actually, that was the first thing I thought of. So I set 
set_time_limit(0); right at the top of the script. Is it possible there 
is another setting for this in php.ini that I also need to deal with? I 
have other scripts running and I don't want to have an unlimited 
execution time on all of them.

Nick

Brent Baisley wrote:

I missed the beginning of this whole thing so excuse me if this has 
been covered. Have you looked at how much time elapses before it dies? 
If the same amount of time lapses before it dies, than that's your 
problem. I don't know what you have your maximum script execution run 
time set to, but you may need to change that number.

On Thursday, March 13, 2003, at 02:36 PM, Nicholas Fitzgerald wrote:

It only does this in one place, though not necessarily the same 
place, depending on where I start, then, afterwards, it goes through 
a few more pages, and that's where it dies. Another thing is, if I 
start from scratch with a site that has 69 pages in it, it goes right 
through and indexes it fine without any problems. I have two other 
sites I'm using for testing, and they both have over 1000 pages. on 
both of them it dies after putting about 240-250 records in the 
database, usually right at 244. This is true of both sites, and it 
happens no matter where I start or how I configure the initial URL.I 
keep going back to a memory problem with either PHP or MySQL, or 
could I be looking in the wrong place? Could the problem be with Apache?

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577





--
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-13 Thread Brent Baisley
I missed the beginning of this whole thing so excuse me if this has been 
covered. Have you looked at how much time elapses before it dies? If the 
same amount of time lapses before it dies, than that's your problem. I 
don't know what you have your maximum script execution run time set to, 
but you may need to change that number.

On Thursday, March 13, 2003, at 02:36 PM, Nicholas Fitzgerald wrote:

It only does this in one place, though not necessarily the same place, 
depending on where I start, then, afterwards, it goes through a few 
more pages, and that's where it dies. Another thing is, if I start from 
scratch with a site that has 69 pages in it, it goes right through and 
indexes it fine without any problems. I have two other sites I'm using 
for testing, and they both have over 1000 pages. on both of them it 
dies after putting about 240-250 records in the database, usually right 
at 244. This is true of both sites, and it happens no matter where I 
start or how I configure the initial URL.I keep going back to a memory 
problem with either PHP or MySQL, or could I be looking in the wrong 
place? Could the problem be with Apache?

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
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-13 Thread Nicholas Fitzgerald
Ok, here's something else I've just noticed about this problem. I 
noticed that when this things gets to a certain point, somewhere in the 
4th run through, it hits a certain url, then the next, at which point it 
seems to pause for several seconds, then it goes back and hits that 
first certain url. It looks something like this:

Updating: http://www.domain.com/certainurl.html
Updating: http://www.domain.com/nexturl.html
Updating: http://www.domain.com/certainurl.html
It only does this in one place, though not necessarily the same place, 
depending on where I start, then, afterwards, it goes through a few more 
pages, and that's where it dies. Another thing is, if I start from 
scratch with a site that has 69 pages in it, it goes right through and 
indexes it fine without any problems. I have two other sites I'm using 
for testing, and they both have over 1000 pages. on both of them it dies 
after putting about 240-250 records in the database, usually right at 
244. This is true of both sites, and it happens no matter where I start 
or how I configure the initial URL.I keep going back to a memory problem 
with either PHP or MySQL, or could I be looking in the wrong place? 
Could the problem be with Apache?

I also wanted to thank you guys. I've gotten a few really good 
suggestions about the code, and although they haven't solved this 
specific problem, they have helped me improve the overall performance of 
the app.

Nick





Paul Burney wrote:

on 3/12/03 5:45 PM, Nicholas Fitzgerald at [EMAIL PROTECTED] appended the
following bits to my mbox:
 

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!
   

I don't think I've found the problem, but I thought I'd point out a couple
things:
 

// Open the database and start looking at URLs
$sql = mysql_query("SELECT * FROM search");
while($rslt = mysql_fetch_array($sql)){
 $url = $rslt["url"];
   

The above line gets all the data from the table and then starts looping
through...
 

// 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){
   

That line does the same query again for this particular URL to set variables
in the $site array, though you already have this info in the $rslt array.
You could potentially save hundreds of queries there.
 

// Get the page title
 $temp = stristr($read,"");
   


 

 $tchn = ($tend - $tpos);
 $title = strip_tags(substr($read, ($tpos+7),$tchn));
   

Aside: Interesting way of doing things.  I usually just preg_match these
things, but I like this too.
 

 // Kill any trailing slashes
 if(substr($link,(strlen($link)-1)) == "/"){
 $link = substr($link,0,(strlen($link)-1));
 }
   

Why are you killing the trailing slashes?  That's going to cause fopen
double the work to get to the pages.  That is, first it will request the
page without the slash, then get a redirect response with the slash, and
then request the page again.
 

 // Put the new URL in the search database
 $chk = mysql_query("SELECT * FROM search WHERE url = '$link'");
 $curec = mysql_fetch_array($chk);
 if(!$curec){
 echo "Adding: $link\n";
 $putup = mysql_query("INSERT INTO search SET url='$link'");
 }
 else{
 continue;
 }
   

You might want to give a different variable name to the "new link", or
encapsulate the above in a function, so your $link variables don't clobber
each other.
 

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.
 

What url is it dieing on?  You could probably echo each $url to the terminal
to watch it's progression and see where it is stopping.
I've had problems with apache using custom php error docs where the error
doc contained a php generated image that wasn't found.  Each image that
failed would generate another PHP error which cascaded until the server
basically died.
KIND OF BROADER ASIDE REGARDING SEARCH ENGINE PROBLEMS:

I've also had recursion problems because p

[PHP-DB] Re: [PHP] setup connection to sybase

2003-03-13 Thread Ray Hunter
With the installation of sybase on the windows 2000 server (client
installation) you will get an interfaces file that contains all the
information for connecting to a sybase database.

Make sure that you have the sybase client installed on the windows 2000
box that is running PHP.

--
ray


On Wed, 2003-03-12 at 23:55, P Lok wrote:
> 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



Re: [PHP-DB] Real Killer App!

2003-03-13 Thread Paul Burney
on 3/12/03 5:45 PM, Nicholas Fitzgerald at [EMAIL PROTECTED] appended the
following bits to my mbox:

> 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!

I don't think I've found the problem, but I thought I'd point out a couple
things:

> // Open the database and start looking at URLs
> $sql = mysql_query("SELECT * FROM search");
> while($rslt = mysql_fetch_array($sql)){
>   $url = $rslt["url"];

The above line gets all the data from the table and then starts looping
through...

> // 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){

That line does the same query again for this particular URL to set variables
in the $site array, though you already have this info in the $rslt array.
You could potentially save hundreds of queries there.

> // Get the page title
>   $temp = stristr($read,"");

>   $tchn = ($tend - $tpos);
>   $title = strip_tags(substr($read, ($tpos+7),$tchn));

Aside: Interesting way of doing things.  I usually just preg_match these
things, but I like this too.


>   // Kill any trailing slashes
>   if(substr($link,(strlen($link)-1)) == "/"){
>   $link = substr($link,0,(strlen($link)-1));
>   }

Why are you killing the trailing slashes?  That's going to cause fopen
double the work to get to the pages.  That is, first it will request the
page without the slash, then get a redirect response with the slash, and
then request the page again.

>   // Put the new URL in the search database
>   $chk = mysql_query("SELECT * FROM search WHERE url = '$link'");
>   $curec = mysql_fetch_array($chk);
>   if(!$curec){
>   echo "Adding: $link\n";
>   $putup = mysql_query("INSERT INTO search SET url='$link'");
>   }
>   else{
>   continue;
>   }

You might want to give a different variable name to the "new link", or
encapsulate the above in a function, so your $link variables don't clobber
each other.

>> 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.

What url is it dieing on?  You could probably echo each $url to the terminal
to watch it's progression and see where it is stopping.

I've had problems with apache using custom php error docs where the error
doc contained a php generated image that wasn't found.  Each image that
failed would generate another PHP error which cascaded until the server
basically died.

KIND OF BROADER ASIDE REGARDING SEARCH ENGINE PROBLEMS:

I've also had recursion problems because php allows any characters to be
appended after the request.  For example, let's say you have an examples.php
file and for some reason you have a relative link in  examples.php to
examples/somefile.html.  If the examples directory doesn't exist, apache
will serve examples.php to the user using the request of
examples/somefile.html.  A recursive search engine (that isn't too smart,
i.e., infoseek and excite for colleges), will keep requesting things like:

http://example.com/examples/examples/examples/examples/examples/examples/exa
mples/examples/examples/examples/examples/examples/examples/examples/example
s/examples/examples/examples/examples/examples/examples/examples/examples/ex
amples/examples/examples/examples/examples/examples/examples/examples/exampl
es/examples/examples/examples/examples/examples/examples/examples/examples/e
xamples/examples/somefile.html

As far as apache is concerned, it is fulfilling the request with the
examples.php file and php just sees a really long query_string starting with
/examples.

I'm sure that isn't your problem, but I've been bit by it a few times.

END OF ASIDE

Hope some of that ramble helps.  Please try to see if it is dieing on a
particular URL so we can be of further assistance.

Sincerely,

Paul Burney


Q: Tired of creating admin interfaces to your MySQL web applications?

A: Use MySTRI instead. Version 3.1 now a

[PHP-DB] Re: textarea data and printing

2003-03-13 Thread Benjamin Walling
Not really sure what you are asking.  Do you want to remove the line breaks
from the textarea entry?  Use str_replace("\n","",$user_input);
str_replace("\r","",$user_input); to remove them.

If you want the user to be able to use the enter key to format the
description, you will have to replace "\n" with  when you display it
back.  HTML ingores whitespace, so "\n" accomplishes nothing.


"Rajesh Fowkar" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
>
> We are accepting Detailed description of the item in
> .
>
> 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  [e.g. whereis man].  See man pages for
> detailed filter options)
> For merely knowing where it lies: which 
>
> <[EMAIL PROTECTED]>##
> :



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



RE: [PHP-DB] sorting problem...

2003-03-13 Thread Snijders, Mark
guess you can better take a look at the group by function of mysql



-Original Message-
From: Ignatius Reilly [mailto:[EMAIL PROTECTED]
Sent: donderdag 13 maart 2003 15:03
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] sorting problem...


Take a look at the MySQL DATE_FORMAT() function.

Ignatius

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 13, 2003 2:43 PM
Subject: [PHP-DB] sorting problem...


> Hi All,
> 
> I need to sort some data from a MySQL table. I have data saved like this:
> 
> ++-++--+
> | id | unixtime| porta_snmp | porta_switch |
> ++-++--+
> |  1 | 2003-01-07 12:23:24 | 1614   | 1|
> |  2 | 2003-01-07 12:24:01 | 1614   | 1|
> |  3 | 2003-01-07 12:29:34 | 1614   | 1|
> |  4 | 2003-01-07 12:30:19 | 1614   | 1|
> |  5 | 2003-01-07 12:31:01 | 1614   | 5|
> |  6 | 2003-01-07 12:32:06 | 1614   | 5|
> |  7 | 2003-01-07 12:33:01 | 1614   | 1|
> |  8 | 2003-02-07 12:34:06 | 1614   | 1|
> |  9 | 2003-02-07 12:35:00 | 1614   | 1|
> | 10 | 2003-02-07 12:36:01 | 1614   | 1|
> ++-++--+
> 
> I neet to sort the data to be able to read it better. In this case I just
> need to filter the data to get only the different info for each day. Some
> thing like this:
> 
> 2003-01-0716141
> 2003-01-0716145
> 2003-02-0716141
> 
> Is this possible ?
> 
> Thank's in advance,
> Gus
> 
> 
> 
> -- 
> 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] sorting problem...

2003-03-13 Thread Ignatius Reilly
Take a look at the MySQL DATE_FORMAT() function.

Ignatius

- Original Message - 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 13, 2003 2:43 PM
Subject: [PHP-DB] sorting problem...


> Hi All,
> 
> I need to sort some data from a MySQL table. I have data saved like this:
> 
> ++-++--+
> | id | unixtime| porta_snmp | porta_switch |
> ++-++--+
> |  1 | 2003-01-07 12:23:24 | 1614   | 1|
> |  2 | 2003-01-07 12:24:01 | 1614   | 1|
> |  3 | 2003-01-07 12:29:34 | 1614   | 1|
> |  4 | 2003-01-07 12:30:19 | 1614   | 1|
> |  5 | 2003-01-07 12:31:01 | 1614   | 5|
> |  6 | 2003-01-07 12:32:06 | 1614   | 5|
> |  7 | 2003-01-07 12:33:01 | 1614   | 1|
> |  8 | 2003-02-07 12:34:06 | 1614   | 1|
> |  9 | 2003-02-07 12:35:00 | 1614   | 1|
> | 10 | 2003-02-07 12:36:01 | 1614   | 1|
> ++-++--+
> 
> I neet to sort the data to be able to read it better. In this case I just
> need to filter the data to get only the different info for each day. Some
> thing like this:
> 
> 2003-01-0716141
> 2003-01-0716145
> 2003-02-0716141
> 
> Is this possible ?
> 
> Thank's in advance,
> Gus
> 
> 
> 
> -- 
> 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] sorting problem...

2003-03-13 Thread guslist
Hi All,

I need to sort some data from a MySQL table. I have data saved like this:

++-++--+
| id | unixtime| porta_snmp | porta_switch |
++-++--+
|  1 | 2003-01-07 12:23:24 | 1614   | 1|
|  2 | 2003-01-07 12:24:01 | 1614   | 1|
|  3 | 2003-01-07 12:29:34 | 1614   | 1|
|  4 | 2003-01-07 12:30:19 | 1614   | 1|
|  5 | 2003-01-07 12:31:01 | 1614   | 5|
|  6 | 2003-01-07 12:32:06 | 1614   | 5|
|  7 | 2003-01-07 12:33:01 | 1614   | 1|
|  8 | 2003-02-07 12:34:06 | 1614   | 1|
|  9 | 2003-02-07 12:35:00 | 1614   | 1|
| 10 | 2003-02-07 12:36:01 | 1614   | 1|
++-++--+

I neet to sort the data to be able to read it better. In this case I just
need to filter the data to get only the different info for each day. Some
thing like this:

2003-01-0716141
2003-01-0716145
2003-02-0716141

Is this possible ?

Thank's in advance,
Gus



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



Re: [PHP-DB] Re: Where have my errors gone?

2003-03-13 Thread - Edwin
Hi,

"Alex Francis" <[EMAIL PROTECTED]> wrote: 
> Got it .
> My ISP had upgraded PHP and left "error reporting" off. They have now 
> fixed it for me.

Great!

But I think you'd have had the same effect if instead of this:

> > I have tried adding error_reporting=E_ALL; to the page, but still no
> > errors.

you've used something like this:

  error_reporting (E_ALL);

More info here:

  http://www.php.net/manual/en/function.error-reporting.php

- E

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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



[PHP-DB] Re: Where have my errors gone?

2003-03-13 Thread Alex Francis
Got it .
My ISP had upgraded PHP and left "error reporting" off. They have now fixed
it for me.

"Alex Francis" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> If I had a syntax error, I used to get a message back telling me. Now I
just
> get a blank page.
> I have tried adding error_reporting=E_ALL; to the page, but still no
errors.
>
>



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



RE: [PHP-DB] Where have my errors gone?

2003-03-13 Thread P . Gertman
you can try 'View Source' in your browser. this can help.
i've got a similar case when PHP error message output was between
 tags.

-Original Message-
From: Alex Francis [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 13, 2003 14:11
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Where have my errors gone?


If I had a syntax error, I used to get a message back telling me. Now I just
get a blank page.
I have tried adding error_reporting=E_ALL; to the page, but still no errors.



-- 
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] Where have my errors gone?

2003-03-13 Thread Snijders, Mark
I know,

it's really anoing

some errors are syntax errors which you can't see

the way I look them up:


put a exit;  in the middle of the page...

you still see nothing, put the exit; higher in the code.. to that until you
see some output again, then you know the syntax error is somewhere below the
exit;

get my point?

-mark-


-Original Message-
From: Alex Francis [mailto:[EMAIL PROTECTED]
Sent: donderdag 13 maart 2003 12:11
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Where have my errors gone?


If I had a syntax error, I used to get a message back telling me. Now I just
get a blank page.
I have tried adding error_reporting=E_ALL; to the page, but still no errors.



-- 
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] Where have my errors gone?

2003-03-13 Thread Alex Francis
If I had a syntax error, I used to get a message back telling me. Now I just
get a blank page.
I have tried adding error_reporting=E_ALL; to the page, but still no errors.



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



RE: [PHP-DB] textarea data and printing

2003-03-13 Thread John W. Holmes
> We are accepting Detailed description of the item in
> .
> 
> 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.

I don't understand what you want. Perhaps you're looking for nl2br()?

www.php.net/nl2br

---John W. Holmes...

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



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



RE: [PHP-DB] PHP script execution - display issue

2003-03-13 Thread John W. Holmes
[snip]
> 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.

Don't put everything inside of one big table. This really depends on the
browser on how it's going to be displayed, not PHP. You can try using
flush() to send the buffer to the browser, but it may or may not help. A
lot of browsers won't show the table until the  tag is reached.
Nothing you can do about that except for breaking up your tables...

---John W. Holmes...

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



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



[PHP-DB] Re: PHP script execution - display issue

2003-03-13 Thread Adam Royle
This is neither a PHP nor database question. This is client side. 
Anyway, a simple fact is that tables won't render until the whole table 
has been loaded into memory (ie. it won't show until it reaches the 
 tag). If you have your whole site inside one big table, then 
this is what is causing your problems. Unfortunately, sometimes this 
unavoidable. To make it run sequentially, you could do this, or use 
divs with absolute positioning. just a thought.

Adam

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


Re: [PHP-DB] PHP script execution - display issue

2003-03-13 Thread Billy
Ok this is going to sound silly but it was becouse I had my 
below the listbox were is I should have put it between 

I think I will have some coffee.

Thanks guys for the help tho


- Original Message -
From: "Rich Gray" <[EMAIL PROTECTED]>
To: "Petre NICOARA" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Thursday, March 13, 2003 10:32 PM
Subject: RE: [PHP-DB] PHP script execution - display issue


> > 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
>
> Try flush() http://www.php.net/manual/en/function.flush.php
> HTH
> Rich
>
> --
> 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] PHP script execution - display issue

2003-03-13 Thread Rich Gray
> 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

Try flush() http://www.php.net/manual/en/function.flush.php
HTH
Rich

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



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

2003-03-13 Thread Snijders, Mark
put in top of your document :

phpinfo();

and see under 'variables' what is in them



-Original Message-
From: Rich Gray [mailto:[EMAIL PROTECTED]
Sent: donderdag 13 maart 2003 10:22
To: Billy; PHP-DB
Subject: RE: [PHP-DB] listbox not adding data to mySql?


> 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...
>
>  
>   No
>   Yes
>  
>
> 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

Can you post the code that handles the form data and updates the database?
Without that it'll be difficult to see what's the problem.

Rich


-- 
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] listbox not adding data to mySql?

2003-03-13 Thread Rich Gray
> 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...
>
>  
>   No
>   Yes
>  
>
> 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

Can you post the code that handles the form data and updates the database?
Without that it'll be difficult to see what's the problem.

Rich


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