php-general Digest 14 Oct 2003 09:57:11 -0000 Issue 2354
Topics (messages 166014 through 166048):
Re: what is the best PHP editor?
166014 by: Ryan A
166016 by: Daniel Guerrier
166017 by: Chris Boget
166019 by: Rob Adams
166021 by: Jonathan Villa
166022 by: Scott Fletcher
166045 by: Davy Obdam
Re: FTP resumepos
166015 by: Curt Zirzow
Re: provide flag -X when connecting to mysql
166018 by: Marek Kilimajer
header() function for displaying an opened PDF document.
166020 by: Scott Fletcher
166023 by: Kevin Stone
166029 by: Scott Fletcher
166031 by: Kevin Stone
166032 by: Bertrand Moulard
166033 by: Bertrand Moulard
Re: php variable
166024 by: Scott Fletcher
166025 by: Scott Fletcher
166039 by: Tom Rogers
Re: Restarting Apache without screwing up running scripts?
166026 by: Scott Fletcher
Re: php convert html to pdf
166027 by: Scott Fletcher
166030 by: Scott Fletcher
166038 by: hycn office
Re: Problem with session_destroy() don't work
166028 by: Scott Fletcher
Slow searches in large database
166034 by: Adrian Teasdale
166035 by: Chris W. Parker
166036 by: Miles Thompson
166046 by: Rory McKinley
(newbie) How to keep files ?
166037 by: Sudheer Palaparambil
166041 by: Mohamed Lrhazi
Re: \n \t don't work!!!
166040 by: Chris Shiflett
Passing variables between pages
166042 by: Rashini Jayasinghe
166043 by: Raditha Dissanayake
166044 by: John Nichel
Foreach Array Help
166047 by: Jed R. Brubaker
Alternative to cURL
166048 by: Paul van Schayck
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Hey Chris,
After reading your post I too downloaded SlickEdit...I personally use a mix
of Zend and EditPlus....
Just opened slickEdit and it seems a bit complicated but more java
oriented...mind telling me why you have such a preference for this?
Cheers,
-Ryan A
http://bestwebhosters.com
> I am not sure what you would consider reasonably priced, but the best
> editor I've come across is Visual Slick Edit. Bar none, the best and
> most feature rich editor I've come across in the last few years.
Hmm.. I downloaded Slick Edit and didn't think it was any better than
the free HTML-Kit. Have you ever used HTML-Kit and if so, what do you
think is so great about VSE?
I didn't spend a huge amount of time with the configuration of VSE but I
couldn't get it to view my Japanese pages properly. Can you set the
character encoding in VSE?
Chris.
p.s. My vote is for HTML-Kit from www.chami.com.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
http://www.phpedit.net
It's good.
How good, is up to you.
--- Rob Adams <[EMAIL PROTECTED]> wrote:
> I like EditPlus too, but recently I've been using
> UltraEdit.
> http://www.ultraedit.com/
> $35 registration. Has great column mode support. I
> use the macros and
> templates all the time. Has a word file for PHP.
>
> -- Rob
>
>
>
> "Dougd" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I currently use EditPlus - and like it -- is there
> anything else out there
> > that is better and still reasonably priced.
> >
> > Thanks.
> >
> > -Doug
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
--- End Message ---
--- Begin Message ---
> Hey Chris,
> After reading your post I too downloaded SlickEdit...I personally use a mix
> of Zend and EditPlus....
> Just opened slickEdit and it seems a bit complicated but more java
> oriented...mind telling me why you have such a preference for this?
It's actually C/C++/Java oriented. But you can set up and configure a PHP
extension.
As to why I like VSE, it is highly configurable and has a fairly powerful macro
language. Just about every piece of internal functionality (ie, any of the menu
options, highlight text, cursor movements, etc) are set up as macro functions.
As a result, you can assign them to any custom button or add them to just about
any right click menu (right click and select 'Edit This Menu' at the bottom).
Little useful toys such as paren & brace matching, automatic indent (even for cut
and pasted code), customizable syntax highlighting, JavaDoc comments aware,
different emulation styles (emacs, VC++, etc), Tagging[1], etc.
As I said before, it has definitely increased my productivity.
Chris
[1] I'm not sure if 'Tag'ging is a commonly used word. But in the context of VSE,
what that means is that you can tell VSE a directory (let's take PEAR for example)
and it'll go through the tree and look at every source file and compile information on
every function/class. So when you are coding and start typing the function (or class)
name, it'll give you argument information and anything else that might have been in
the JavaDoc or PHPDoc comments. Very, very helpful.
--- End Message ---
--- Begin Message ---
I actually tried this a while ago, and must've had a really early version.
It showed a lot of promise, but there were too many problems, and the error
text was mostly German, so I couldn't tell what was wrong or how to fix it.
I'll have to give it another shot now.
-- Rob
"Daniel Guerrier" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> http://www.phpedit.net
>
> It's good.
> How good, is up to you.
>
> --- Rob Adams <[EMAIL PROTECTED]> wrote:
> > I like EditPlus too, but recently I've been using
> > UltraEdit.
> > http://www.ultraedit.com/
> > $35 registration. Has great column mode support. I
> > use the macros and
> > templates all the time. Has a word file for PHP.
> >
> > -- Rob
> >
> >
> >
> > "Dougd" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > I currently use EditPlus - and like it -- is there
> > anything else out there
> > > that is better and still reasonably priced.
> > >
> > > Thanks.
> > >
> > > -Doug
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Shopping - with improved product search
> http://shopping.yahoo.com
--- End Message ---
--- Begin Message ---
What's the matter? No one likes Zend Studio?
On Mon, 2003-10-13 at 12:00, Chris Boget wrote:
> > I currently use EditPlus - and like it -- is there anything else out there
> > that is better and still reasonably priced.
>
> I am not sure what you would consider reasonably priced, but the best
> editor I've come across is Visual Slick Edit. Bar none, the best and most
> feature rich editor I've come across in the last few years.
>
> Chris
--- End Message ---
--- Begin Message ---
Yea, I tried it from before and it seem to be somewhat limit. The only good
thing about it is that with each of the newer version, it get better and
better. I have been sticking to Visual Slick Edit along the way. It would
have been nice if it can transfer files between two webservers if this is
possible.
Scott F.
"Rob Adams" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I actually tried this a while ago, and must've had a really early version.
> It showed a lot of promise, but there were too many problems, and the
error
> text was mostly German, so I couldn't tell what was wrong or how to fix
it.
> I'll have to give it another shot now.
>
> -- Rob
>
>
>
> "Daniel Guerrier" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > http://www.phpedit.net
> >
> > It's good.
> > How good, is up to you.
> >
> > --- Rob Adams <[EMAIL PROTECTED]> wrote:
> > > I like EditPlus too, but recently I've been using
> > > UltraEdit.
> > > http://www.ultraedit.com/
> > > $35 registration. Has great column mode support. I
> > > use the macros and
> > > templates all the time. Has a word file for PHP.
> > >
> > > -- Rob
> > >
> > >
> > >
> > > "Dougd" <[EMAIL PROTECTED]> wrote in message
> > > news:[EMAIL PROTECTED]
> > > > I currently use EditPlus - and like it -- is there
> > > anything else out there
> > > > that is better and still reasonably priced.
> > > >
> > > > Thanks.
> > > >
> > > > -Doug
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > The New Yahoo! Shopping - with improved product search
> > http://shopping.yahoo.com
--- End Message ---
--- Begin Message ---
Zend Studio is definatly my choice-), sometimes i use EditPlus too, to
edit html/css/javascript, but all my PHP coding is done in zend studio.
Best regards,
Davy
Jonathan Villa wrote:
What's the matter? No one likes Zend Studio?
On Mon, 2003-10-13 at 12:00, Chris Boget wrote:
I currently use EditPlus - and like it -- is there anything else out there
that is better and still reasonably priced.
I am not sure what you would consider reasonably priced, but the best
editor I've come across is Visual Slick Edit. Bar none, the best and most
feature rich editor I've come across in the last few years.
Chris
--- End Message ---
--- Begin Message ---
* Thus wrote Andrei Popovici ([EMAIL PROTECTED]):
> Can anyone help me understand how the parameter resumepos from ftp_get
> function can be used?
ftp_get will first seek the value 'resumepos' within the
'remote_file', before it starts to write to 'local_file'.
Curt
--
"My PHP key is worn out"
PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/
--- End Message ---
--- Begin Message ---
No, I haven't used any, but search www.phpclasses.org and choose the one
with the best rating.
Victor Spång Arthursson wrote:
2003-10-13 kl. 16.39 skrev Marek Kilimajer:
No, it is not. But there are plenty of classes that can do it for you.
Can you recommend any?
Sincerely
Victor
--- End Message ---
--- Begin Message ---
I seem to be having problem with sending the PDF document to the browser to
be open on screen. I kept getting the error message, it say 'Windows cannot
open this file'. Here's my sample script, so what am I doing wrong?...
--snip--
header("Content-Type: application/pdf");
header("Content-Length: '40736'");
header("Content-Disposition: inline; filename='junk.pdf'");
--snip--
Thanks,
Scott F.
--- End Message ---
--- Begin Message ---
Forget the content length and disposition headers. Just set the content type then
output the file..
header("Content-type: application/pdf");
readfile("junk.pdf");
- Kevin
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> I seem to be having problem with sending the PDF document to the browser to
> be open on screen. I kept getting the error message, it say 'Windows cannot
> open this file'. Here's my sample script, so what am I doing wrong?...
>
> --snip--
> header("Content-Type: application/pdf");
> header("Content-Length: '40736'");
> header("Content-Disposition: inline; filename='junk.pdf'");
> --snip--
>
> Thanks,
> Scott F.
--- End Message ---
--- Begin Message ---
I can't do readfile() because of lots of bug in IE (Internet Explorer)....
"Kevin Stone" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Forget the content length and disposition headers. Just set the content
type then output the file..
>
> header("Content-type: application/pdf");
> readfile("junk.pdf");
>
> - Kevin
>
> "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > I seem to be having problem with sending the PDF document to the browser
to
> > be open on screen. I kept getting the error message, it say 'Windows
cannot
> > open this file'. Here's my sample script, so what am I doing wrong?...
> >
> > --snip--
> > header("Content-Type: application/pdf");
> > header("Content-Length: '40736'");
> > header("Content-Disposition: inline; filename='junk.pdf'");
> > --snip--
> >
> > Thanks,
> > Scott F.
>
--- End Message ---
--- Begin Message ---
I'm sorry but it can't be done. You cannot output a file without printing it to the
output buffer. You cannot print a file to the output buffer without opening the file
into memory. You cannot open a file into memory without using a function like fopen()
or readfile(). It's as simple as that.
There must be something wrong with Internet Explorer on your end. Corrupt files
perhaps? Try installing the latest update, or use system restore to go back a few
weeks, or reinstall the components from the Windows CD. That's my best advice. But I
guarentee this is not a PHP problem and that there is no work around for it other than
to fix what's wrong on your system. Good luck.
Once everything is working you will see the PDF open in the browser plugin when you
set the Content-type header. And you should see a download prompt when you set the
Content-disposition header.
- Kevin
"Scott Fletcher" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> I can't do readfile() because of lots of bug in IE (Internet Explorer)....
>
> "Kevin Stone" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Forget the content length and disposition headers. Just set the content
> type then output the file..
> >
> > header("Content-type: application/pdf");
> > readfile("junk.pdf");
> >
> > - Kevin
> >
> > "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > > I seem to be having problem with sending the PDF document to the browser
> to
> > > be open on screen. I kept getting the error message, it say 'Windows
> cannot
> > > open this file'. Here's my sample script, so what am I doing wrong?...
> > >
> > > --snip--
> > > header("Content-Type: application/pdf");
> > > header("Content-Length: '40736'");
> > > header("Content-Disposition: inline; filename='junk.pdf'");
> > > --snip--
> > >
> > > Thanks,
> > > Scott F.
> >
--- End Message ---
--- Begin Message ---
Might not be connected at all, but I had a similar problem with pdf stored
in a postgreSQL database as large object. The content type was set to pdf,
but ie wouldn't open it. It turned up that it was because there was a CRLF
at the end of one of my script, which spoiled the whole output. Pretty dumb
thing, but it kept me busy for a good hour. If you're desperate for a
solution, look for an unwanted new line somewhere in your file out of the <?
?> tags.
good luck
.b
-----Original Message-----
From: Scott Fletcher [mailto:[EMAIL PROTECTED]
Sent: 13 October 2003 22:15
To: [EMAIL PROTECTED]
Subject: [PHP] header() function for displaying an opened PDF document.
I seem to be having problem with sending the PDF document to the browser to
be open on screen. I kept getting the error message, it say 'Windows cannot
open this file'. Here's my sample script, so what am I doing wrong?...
--snip--
header("Content-Type: application/pdf");
header("Content-Length: '40736'");
header("Content-Disposition: inline; filename='junk.pdf'");
--snip--
Thanks,
Scott F.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
now that I'm rethinking of it, I solved the problem by using the brilliant
python program tcpwatch, which logs all the http data going in and out your
browser. Very easy to run and so handy (not only for this problem). Would
find the url for dld if you want.
cheers
.b
-----Original Message-----
From: Scott Fletcher [mailto:[EMAIL PROTECTED]
Sent: 13 October 2003 22:15
To: [EMAIL PROTECTED]
Subject: [PHP] header() function for displaying an opened PDF document.
I seem to be having problem with sending the PDF document to the browser to
be open on screen. I kept getting the error message, it say 'Windows cannot
open this file'. Here's my sample script, so what am I doing wrong?...
--snip--
header("Content-Type: application/pdf");
header("Content-Length: '40736'");
header("Content-Disposition: inline; filename='junk.pdf'");
--snip--
Thanks,
Scott F.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Should also work if you use the POST method...
"Comex" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> <[EMAIL PROTECTED]>
> Onno Kuipers:
> > Jay Blanchard wrote:
> >> [snip]
> >> $var=¨How are you¨;
> >> THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO.
> >> [/snip]
> >>
> >> Pleace $var in a hidden form element.
> >
> > I tried... something like this
> >
> > <input type="hidden" name="var2"
> > value=¨<?php print $var2; ?>¨>
> >
> > but it doesn't work. Maybe you mean something totaly different, can
> > you show me what you mean.
>
> Should work, if not use sessions.
--- End Message ---
--- Begin Message ---
Page 1
<input type="hidden" name="var2" value="test">
Page 2
echo $_REQUEST['var2'];
//or
echo $_POST['var2'];
//==========
//Sometime noticed some glitch with $_POST because sometime PHP think the
data go to $_GET...
//So, to prevent future headache, I use $_REQUEST['var2'] at all time...
//==========
Scott
"Comex" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> <[EMAIL PROTECTED]>
> Onno Kuipers:
> > Jay Blanchard wrote:
> >> [snip]
> >> $var=¨How are you¨;
> >> THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO.
> >> [/snip]
> >>
> >> Pleace $var in a hidden form element.
> >
> > I tried... something like this
> >
> > <input type="hidden" name="var2"
> > value=¨<?php print $var2; ?>¨>
> >
> > but it doesn't work. Maybe you mean something totaly different, can
> > you show me what you mean.
>
> Should work, if not use sessions.
--- End Message ---
--- Begin Message ---
Hi,
Tuesday, October 14, 2003, 12:42:18 AM, you wrote:
OK> Jay Blanchard wrote:
>> [snip]
>> $var=¨How are you¨;
>> THE PROBLEM IS THAT I ALSO WANT TO USE $VAR IN SCRIPTTWO.
>> [/snip]
>>
>> Pleace $var in a hidden form element.
OK> I tried... something like this
OK> <input type="hidden" name="var2"
OK> value=¨<?php print $var2; ?>¨>
OK> but it doesn't work. Maybe you mean something totaly different, can you
OK> show me what you mean.
Make sure you put the hidden part between form tags
<form action="<?php echo $_SERVER['PHP_SELF']?>" method="post">
<input type="hidden" name="var2" value="<?php echo $var2?>">
<input type="submit">
</form>
--
regards,
Tom
--- End Message ---
--- Begin Message ---
Wow! I didn't know that. I have been using apachectl restart all the time.
Now I feel better that this feature will allow Apache to be running until
people logged off of the website (by the mean of terminating the apache
connection)....
Thanks!!!
"Marek Kilimajer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
# apachectl graceful
snip from manpage:
graceful Gracefully restarts the Apache daemon by send
ing it a SIGUSR1. If the daemon is not run
ning, it is started. This differs from a nor
mal restart in that currently open connections
are not aborted. A side effect is that old
log files will not be closed immediately.
This means that if used in a log rotation
script, a substantial delay may be necessary
to ensure that the old log files are closed
before processing them. This command automat
ically checks the configuration files via con
figtest before initiating the restart to make
sure Apache doesn't die.
Donald Tyler wrote:
> Hi,
>
>
>
>
>
> We are building an Intranet for our company and I was wondering how
> people deal with having to restart the server when its running an
> intranet. Obviously if there is a complex process running and the server
> restarts in the middle of it then its going to screw a lot of stuff up.
>
>
>
> The only thing I could think of was to script the Intranet in such a way
> as I could go into the admin section and simply disable it, then all the
> currently running processes would finish, but the system would refuse to
> start any new ones until I re-enabled it again.
>
>
>
> Just want some advice, thanks.
>
>
>
>
>
> Donald
>
>
--- End Message ---
--- Begin Message ---
I'm not aware of any such feature that would convert the HTML to PHP. You
can use the FPDF library to generate a PDF stuffs without installing or
compiling or anything of thsoe sort. You can find it at www.fpdf.org. It
is free and it is pretty nice.
Scott F.
"Hycn Office" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi all ~
>
> where can find the free of charge complete script ?
>
> remarks : i am using web hosting , so cant install anything
>
> thank you "-_-
--- End Message ---
--- Begin Message ---
Hey, Hey, Hey, found it on the Internet on converting HTML to PDF. Take a
look at this at
http://www.rustyparts.com/pdf.php
"Hycn Office" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> hi all ~
>
> where can find the free of charge complete script ?
>
> remarks : i am using web hosting , so cant install anything
>
> thank you "-_-
--- End Message ---
--- Begin Message ---
but i cant install html2ps
and fpdf cant convert , need to build from scratch
i think only solution is need to setup a server .... no choice
thanks ~
"Scott Fletcher" <[EMAIL PROTECTED]> ¦b¶l¥ó
news:[EMAIL PROTECTED] ¤¤¼¶¼g...
> Hey, Hey, Hey, found it on the Internet on converting HTML to PDF. Take a
> look at this at
>
> http://www.rustyparts.com/pdf.php
>
>
> "Hycn Office" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > hi all ~
> >
> > where can find the free of charge complete script ?
> >
> > remarks : i am using web hosting , so cant install anything
> >
> > thank you "-_-
>
>
--- End Message ---
--- Begin Message ---
session_destroy() don't work too well with IE (Internet Explorer) due to
bunch of bugs that IE have. That is if you are using IE to test this....
"Kostas" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I have a problem with destroing a session.
> I have made a login page and the login work ok.
> I register the things i want like that:
> <?
> session_register(uid); $uid= mysql_result($result,0,'userid');
> session_register(pwd); $pwd= mysql_result($result,0,'password');
> session_register(name); $name= mysql_result($result,0,'name');
> session_register(memberid); $memberid= mysql_result($result,0,'id');
> ?>
>
> I try to make the logout page like that:
>
> <?php
>
> session_start();
> session_unset();
> session_destroy();
> ?>
>
> but it dont work.
> I have
> a.. PHP - 4.0.5
> a.. MySQL - 3.23.32
> a.. Apache - 1.3.14
> a.. PHPMyAdmin - 2.1.0
> a.. Perl - nsPerl 5.005_03
>
> session.auto_start Off
> session.cache_expire 180
> session.cache_limiter nocache
> session.cookie_domain no value
> session.cookie_lifetime 0
> session.cookie_path /
> session.entropy_file no value
> session.entropy_length 0
> session.gc_maxlifetime 1440
> session.gc_probability 1
> session.name PHPSESSID
> session.referer_check no value
> session.save_handler files
> session.save_path c:/php4/sessions
> session.serialize_handler php
> session.use_cookies On
>
> installed apache on win2000
>
> The session is not destroyd. Session_unset dont work to.
> Can someone help me?
> thanks.
>
--- End Message ---
--- Begin Message ---
Hi there
Wondering if someone could help or give some advice.
We have a mysql database that has approximately 20,000 records and has a
total size of 125mb There are approximately 25 fields that we need to
search each time that someone performs a search. We have installed
TurckMMCache onto the server which speeded up the searching, but it
still takes around 15 seconds for the results to be displayed.
An example of one of our search strings is:
select docs.* from docs where 1 and CY IN ('GB') and (TI like
'%searchstring%' or PD like '%searchstring%' or ND like '%searchstring%'
or DR like '%searchstring%' or DS like '%searchstring%' or DD like
'%searchstring%' or DT like '%searchstring%' or RN like '%searchstring%'
or HD like '%searchstring%' or TD like '%searchstring%' or NC like
'%searchstring%' or PR like '%searchstring%' or RP like '%searchstring%'
or AA like '%searchstring%' or TY like '%searchstring%' or AC like
'%searchstring%' or PC like '%searchstring%' or RC like '%searchstring%'
or RG like '%searchstring%' or AU like '%searchstring%' or TW like
'%searchstring%' or CO like '%searchstring%' or AB like '%searchstring%'
or TX like '%searchstring%')
Basically, is there anything that anyone can immediately suggest that we
need to do to speed things up?
Thanks
Ade
--- End Message ---
--- Begin Message ---
Adrian Teasdale <mailto:[EMAIL PROTECTED]>
on Monday, October 13, 2003 3:54 PM said:
> An example of one of our search strings is:
[snip]
> Basically, is there anything that anyone can immediately suggest that
> we need to do to speed things up?
1. You could try changing 'docs.*' to a verbose list of each field you
want to SELECT. I've been told through numerous sources that even if you
are ultimately going to SELECT each field in a table it's still faster
to explicitly name those fields because the server does not need to
query the table ahead of time.
2. Why don't you explain what your database is used for and what each
field does? It's possible that there may be a more efficient way to
write your table thus resulting in faster search times.
3. I don't know much about indexes but are there indexes on each field
that you are searching? As far as I know indexes are supposed to be
searching up.
hth,
chris.
--
Don't like reformatting your Outlook replies? Now there's relief!
http://home.in.tum.de/~jain/software/outlook-quotefix/
--- End Message ---
--- Begin Message ---
Start by checking the MySQL docs to find out if indexes are used with "IN"
and "LIKE" especially as the latter is using wildcards. I suspect not.
Given that you are essentially performing a sequential read of the
database and checking on all these fields your performance is remarkably good.
Soltuion? Use indexes wherever possible and refine you query. Do you have
to search on all those fields, is there any way of deriving a subset?
Alternately, investigate MySQL full-text search and see if you can put that
to work for you.
I also recommend posting this question on the MySQL list as it's really a
db, not a PHP question.
Cheers - Miles Thompson
At 11:54 PM 10/13/2003 +0100, Adrian Teasdale wrote:
Hi there
Wondering if someone could help or give some advice.
We have a mysql database that has approximately 20,000 records and has a
total size of 125mb There are approximately 25 fields that we need to
search each time that someone performs a search. We have installed
TurckMMCache onto the server which speeded up the searching, but it
still takes around 15 seconds for the results to be displayed.
An example of one of our search strings is:
select docs.* from docs where 1 and CY IN ('GB') and (TI like
'%searchstring%' or PD like '%searchstring%' or ND like '%searchstring%'
or DR like '%searchstring%' or DS like '%searchstring%' or DD like
'%searchstring%' or DT like '%searchstring%' or RN like '%searchstring%'
or HD like '%searchstring%' or TD like '%searchstring%' or NC like
'%searchstring%' or PR like '%searchstring%' or RP like '%searchstring%'
or AA like '%searchstring%' or TY like '%searchstring%' or AC like
'%searchstring%' or PC like '%searchstring%' or RC like '%searchstring%'
or RG like '%searchstring%' or AU like '%searchstring%' or TW like
'%searchstring%' or CO like '%searchstring%' or AB like '%searchstring%'
or TX like '%searchstring%')
Basically, is there anything that anyone can immediately suggest that we
need to do to speed things up?
Thanks
Ade
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi Adrian
Somewhere in the back of my mind..I remember reading that if you are using
LIKE putting in wildcards for and aft e.g %string% slows down queries
somewhat....
I will have a look at my mySQL stuff and see if I can confirm...but if I
recall correctly, is there any way you can do away with one of the
wildcards?
Rory McKinley
Nebula Solutions
+27 82 857 2391
[EMAIL PROTECTED]
"There are 10 kinds of people in this world,
those who understand binary and those who don't" (Unknown)
----- Original Message -----
From: "Adrian Teasdale" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 14, 2003 12:54 AM
Subject: [PHP] Slow searches in large database
> Hi there
>
> Wondering if someone could help or give some advice.
>
> We have a mysql database that has approximately 20,000 records and has a
> total size of 125mb There are approximately 25 fields that we need to
> search each time that someone performs a search. We have installed
> TurckMMCache onto the server which speeded up the searching, but it
> still takes around 15 seconds for the results to be displayed.
>
> An example of one of our search strings is:
>
> select docs.* from docs where 1 and CY IN ('GB') and (TI like
> '%searchstring%' or PD like '%searchstring%' or ND like '%searchstring%'
> or DR like '%searchstring%' or DS like '%searchstring%' or DD like
> '%searchstring%' or DT like '%searchstring%' or RN like '%searchstring%'
> or HD like '%searchstring%' or TD like '%searchstring%' or NC like
> '%searchstring%' or PR like '%searchstring%' or RP like '%searchstring%'
> or AA like '%searchstring%' or TY like '%searchstring%' or AC like
> '%searchstring%' or PC like '%searchstring%' or RC like '%searchstring%'
> or RG like '%searchstring%' or AU like '%searchstring%' or TW like
> '%searchstring%' or CO like '%searchstring%' or AB like '%searchstring%'
> or TX like '%searchstring%')
>
> Basically, is there anything that anyone can immediately suggest that we
> need to do to speed things up?
>
> Thanks
>
> Ade
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
Hi,
I have a few gif files and five php files and using
mysql database and planning a shared hosting. The web
contents are static. How should I keep the files in my
web space? Should I restrict access to the php files?
How do I safeguard my mysql login parameters (which I
hard coded in the php files)? Pls help.
Thank you.
Sudheer.
_________________________________________________________________
Access Hotmail from your mobile now.
http://server1.msn.co.in/sp03/mobilesms/ Click here.
--- End Message ---
--- Begin Message ---
Your question is not clear enough.... Who are you trying to protect your
files from?
All of you files must be accessible to the web server and to yourself,
via ftp or ssh or sth.
your php script needs the mysql login info... where would it find them,
if not hard coded in the script, or in a file accessible to the script?
Mohamed~
On Mon, 2003-10-13 at 20:40, Sudheer Palaparambil wrote:
> Hi,
>
> I have a few gif files and five php files and using
> mysql database and planning a shared hosting. The web
> contents are static. How should I keep the files in my
> web space? Should I restrict access to the php files?
> How do I safeguard my mysql login parameters (which I
> hard coded in the php files)? Pls help.
>
> Thank you.
>
> Sudheer.
>
> _________________________________________________________________
> Access Hotmail from your mobile now.
> http://server1.msn.co.in/sp03/mobilesms/ Click here.
--- End Message ---
--- Begin Message ---
--- Eugene Lee <[EMAIL PROTECTED]> wrote:
> Note that nl2br() is XHTML compliant, which means it sends out
> "<br />" tags instead of "<br>" tags. This is a problem on
> browsers that do poorly with mixed HTML and XHTML tag styles in the
> same body content.
Which browsers does this refer to?
Chris
=====
My Blog
http://shiflett.org/
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp
--- End Message ---
--- Begin Message ---
Hi,
I want to pass a variable between three pages. I tried to get a username from the
first page through a form. Use that username in a select statement in the second page
to query a table.Everything is fine up to that point. now I want to pass the same
username to the third page where I have to use it to select a table name by that
username and it doesn't work. I tried $_POST['username'] and the value is not passed
to the third page. Is there a way of doing this?
Please help.
Thank You.
Rashini
--- End Message ---
--- Begin Message ---
Hi,
You need to use sessions. Please refer session handling functions in the
manual. Having said that it's a bad idea to put username in a session.
You need to have some kind of association between session ids and
username's in app. The most common way this is done is with a two column
table.
all the best
Rashini Jayasinghe wrote:
Hi,
I want to pass a variable between three pages. I tried to get a username from the first page through a form. Use that username in a select statement in the second page to query a table.Everything is fine up to that point. now I want to pass the same username to the third page where I have to use it to select a table name by that username and it doesn't work. I tried $_POST['username'] and the value is not passed to the third page. Is there a way of doing this?
Please help.
Thank You.
Rashini
--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/ | http://www.raditha/megaupload/
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.
--- End Message ---
--- Begin Message ---
Rashini Jayasinghe wrote:
Hi,
I want to pass a variable between three pages. I tried to get a username from the first page through a form. Use that username in a select statement in the second page to query a table.Everything is fine up to that point. now I want to pass the same username to the third page where I have to use it to select a table name by that username and it doesn't work. I tried $_POST['username'] and the value is not passed to the third page. Is there a way of doing this?
Please help.
Thank You.
Rashini
Please wrap your emails to the list.
Are you using a form to go from page two to page three? If so...
<input type='hidden' name='username' value='<?php echo (
$_POST['username'] ); ?>'>
If not, save it in a session variable (I would actually use this method
even if I did have a form on the second page).
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--- End Message ---
--- Begin Message ---
Okay, total newbie when it comes to arrays, and I could really use some
help. I sure this will be an easy one for you veterans out there.
Here is the array ($code):
array(2) {
["total"]=>
int(1)
["assign"]=>
array(1) {
[1]=>
array(3) {
["type"]=>
string(10) "Transcript"
["rows"]=>
string(3) "603"
["codeapply"]=>
array(1) {
[1]=>
array(3) {
["codeset"]=>
string(23) "FFT 6 Level Code System"
["code_rows"]=>
string(3) "302"
["code_complete"]=>
string(1) "2"
}
}
}
}
}
Here is the output code:
foreach ($this->code['assign'] as $assign => $details)
{
foreach ($assign['codeapply'] as $codeapply => $ca_details)
{
echo "<tr>";
echo "<td>";
echo $details['type']." ".$assign;
echo "</a>";
echo "</td>";
echo "<td>";
echo $ca_details['codeset'];
echo "</td>";
echo "<td>";
echo
$ca_details['code_complete']."/".$ca_details['code_rows']." Items Coded";
echo "</td>";
echo "<td>";
printf (" %.0d%%",
($ca_details['code_complete']/$ca_details['code_rows'])*100);
echo "</td>";
echo "</tr>";
}
}
Output error:
Warning: Cannot use a scalar value as an array
Warning: Invalid argument supplied for foreach()
Conceptually and practically I have been struggling with how to navigate
levels of the arrays which are defined by a variable (e.g.
$code['assign'][$i] for the assign ID and $code['assign'][$i][$j] for the
codeapply ID on the assign ID).
Thanks in advance!
--- End Message ---
--- Begin Message ---
Hello everyone,
I want to send a form to a different server without user input. Auto fill a
form ($_POST or $_GET). People will still click a link. So it could be a
client-side sollution. cURL is the logical sollution but is there an
alternative, client or server side.
I was thinking about FSockOpen and putting a header() inside so the
location in the browser looks like the other domain. Would this be
possible.
Regards,
Paul van Schayck
--- End Message ---