Re: [PHP] Best practices for using MySQL index
On Thu, May 1, 2008 at 9:54 AM, Larry Garfield <[EMAIL PROTECTED]> wrote: > On Wednesday 30 April 2008, Chris wrote: > > >> Index on most integer fields only. Text fields can be indexed, but is > > >> not important when you design your DB well. > > >> > > >> Don't index just all integer fields. Keep track of the cardinality of > a > > >> column. If you expect a field to have 100.000 records, but with only > 500 > > >> distinct values it has no use to put an index on that column. A full > > >> record search is quicker. > > > > > >Hmmm... That's new. :) > > > > To explain that further the idea is that if you have something like a > > 'status' field which can only hold 5 values, there's no point indexing > > it if there's a reasonably even spread. > > > > If you could only ever have a handful of fields with a status code of > > '1', then it's worth indexing if you have to find those particular > > records quickly. I don't think mysql supports partial indexes, but some > > databases do so you only index the fields that match a certain criteria. > > > > I'd suggest a more thorough approach to working out what to index rather > > than just trying to guess what's going on. > > Another piece of low-hanging-fruit is to index a field that you will be > joining on frequently. The fact is, we seldom use join. Because we think it very slow to make it working on two tables with millions of records. Though we did not try it. :( > Point above about spread still applies, but if you > can join index to index, the join goes a lot faster. (A primary key in > MySQL > is always indexed.) > How much is the *a lot*? Thanks. :) > > Having too many indexes rarely if ever costs on read (as far as I am > aware), > but it does cost on write to update the index. How much that matters is > use-case specific. > > -- > Larry Garfield AIM: LOLG42 > [EMAIL PROTECTED] ICQ: 6817012 > > "If nature has made any one thing less susceptible than all others of > exclusive property, it is the action of the thinking power called an idea, > which an individual may exclusively possess as long as he keeps it to > himself; but the moment it is divulged, it forces itself into the > possession > of every one, and the receiver cannot dispossess himself of it." -- > Thomas > Jefferson > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shelley
Re: [PHP] Best practices for using MySQL index
On Wed, Apr 30, 2008 at 7:03 PM, Aschwin Wesselius <[EMAIL PROTECTED]> wrote: > Shelley wrote: > > Don't index just all integer fields. Keep track of the cardinality of a > column. If you expect a field to have 100.000 records, but with only 500 > distinct values it has no use to put an index on that column. A full record > search is quicker. > > > Hmmm... That's new. :) > > > > Well, to give you a good measure: keep the cardinality between 30 to 70-80 > percent of your total records in a column. But sometimes your field is NULL > or empty, so it really depends. You can't just put it into a standard > configuration. And it also really depends on how many records a table > contains etc. > > Besides that, benchmarking your development environment (you do have one > do you?) can gives you a good idea on how your hardware and setup performs. > I think I missed that part. For I am concerning query, index, and entity design most of the time. > > > Aschwin Wesselius > -- Regards, Shelley
Re: [PHP] problem imap_headerinfo
Hi Richard Like Chris replied, then the returned value of imap_headerinfo() is an stdClass object. You can iterate though all the object properties like this: $header = ''; foreach($mail_head as $headerbit => $value) { if(empty($value)) { continue; } $header .= $headerbit . ': ' . $value . "\r\n"; } and then: echo $header; You might wanna change the $headerbit to look abit more readable =) Cheers, Kalle - Original Message - From: "Richard Kurth" <[EMAIL PROTECTED]> To: "PHP General List" Sent: Thursday, May 01, 2008 5:05 AM Subject: [PHP] problem imap_headerinfo I get a *Catchable fatal error*: Object of class stdClass could not be converted to string on this line $mail_head = imap_headerinfo($conn, $i); if I remove it it works fine what would be casing this I really need to read the header. I am using php version 5.2.5 $conn = @imap_open("{" . $bouncer['host'] . ":" . $bouncer['port'] . "/" . $bouncer['mailtype'] . "/notls}" . $bouncer['mailbox'], $bouncer['username'], $bouncer['password']); $headers = @imap_headers($conn); if ($headers) { $email_count = sizeof($headers); for($i = 1; $i <= $email_count; $i++) { # Check the body against all saved patterns $mail_head = imap_headerinfo($conn, $i); $mail_body = imap_fetchbody($conn, $i, 1); echo "mail head: $mail_head\n"; echo "mail body: $mail_body\n"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.7/1408 - Release Date: 30-04-2008 18:10 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem imap_headerinfo
Richard Kurth wrote: > I get a *Catchable fatal error*: Object of class stdClass could not be > converted to string on this line $mail_head = imap_headerinfo($conn, $i); RTM. http://www.php.net/imap_headerinfo It's an object, not a string. print_r($mail_head); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem imap_headerinfo
I get a *Catchable fatal error*: Object of class stdClass could not be converted to string on this line $mail_head = imap_headerinfo($conn, $i); if I remove it it works fine what would be casing this I really need to read the header. I am using php version 5.2.5 $conn = @imap_open("{" . $bouncer['host'] . ":" . $bouncer['port'] . "/" . $bouncer['mailtype'] . "/notls}" . $bouncer['mailbox'], $bouncer['username'], $bouncer['password']); $headers = @imap_headers($conn); if ($headers) { $email_count = sizeof($headers); for($i = 1; $i <= $email_count; $i++) { # Check the body against all saved patterns $mail_head = imap_headerinfo($conn, $i); $mail_body = imap_fetchbody($conn, $i, 1); echo "mail head: $mail_head\n"; echo "mail body: $mail_body\n"; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best practices for using MySQL index
On Wednesday 30 April 2008, Chris wrote: > >> Index on most integer fields only. Text fields can be indexed, but is > >> not important when you design your DB well. > >> > >> Don't index just all integer fields. Keep track of the cardinality of a > >> column. If you expect a field to have 100.000 records, but with only 500 > >> distinct values it has no use to put an index on that column. A full > >> record search is quicker. > > > >Hmmm... That's new. :) > > To explain that further the idea is that if you have something like a > 'status' field which can only hold 5 values, there's no point indexing > it if there's a reasonably even spread. > > If you could only ever have a handful of fields with a status code of > '1', then it's worth indexing if you have to find those particular > records quickly. I don't think mysql supports partial indexes, but some > databases do so you only index the fields that match a certain criteria. > > I'd suggest a more thorough approach to working out what to index rather > than just trying to guess what's going on. Another piece of low-hanging-fruit is to index a field that you will be joining on frequently. Point above about spread still applies, but if you can join index to index, the join goes a lot faster. (A primary key in MySQL is always indexed.) Having too many indexes rarely if ever costs on read (as far as I am aware), but it does cost on write to update the index. How much that matters is use-case specific. -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 "If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it." -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable varialbe with array not working
I am trying to use variable variables in an array. ?The last line of code does not work. ?More specifically the last variable in the last line of code does not work in this setup. ?The array gets created with the appropriate indexes however the values are blank. ?I can echo item_value and it contains a string by the time it gets to that line. ?If I use text instead of a variable for the value it works. ?Is my code wrong or could this be a bug? The file that is read has the following format: item_1_name= Dummy Text 1 item_1_price=10 item_1_date=Jan 10-14, 2008 item_2_name=Dummy Text 2 item_2_price=20 item_2_date=Feb 1-5, 2008
Re: [PHP] Best practices for using MySQL index
>> Index on most integer fields only. Text fields can be indexed, but is not >> important when you design your DB well. >> >> Don't index just all integer fields. Keep track of the cardinality of a >> column. If you expect a field to have 100.000 records, but with only 500 >> distinct values it has no use to put an index on that column. A full record >> search is quicker. > >Hmmm... That's new. :) To explain that further the idea is that if you have something like a 'status' field which can only hold 5 values, there's no point indexing it if there's a reasonably even spread. If you could only ever have a handful of fields with a status code of '1', then it's worth indexing if you have to find those particular records quickly. I don't think mysql supports partial indexes, but some databases do so you only index the fields that match a certain criteria. I'd suggest a more thorough approach to working out what to index rather than just trying to guess what's going on. Work out how long queries are taking (either use the mysql slow log or if you're using a database abstraction class, it should be easy enough to hack in) and concentrate on those first. http://www.designmagick.com/article/16/PostgreSQL/How-to-index-a-database (While it's on a postgresql site, there's nothing specifically for postgresql in that article - the same rules apply to mysql, oracle, mssql). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] check if any element of an array is not "empty"
On Wed, Apr 30, 2008 at 2:58 PM, Richard Heyes <[EMAIL PROTECTED]> wrote: > but I was thinking if there is the function does that. >> > > array_filter(). Note this: > > "If no callback is supplied, all entries of input equal to FALSE (see > converting to boolean) will be removed." > > http://uk3.php.net/manual/en/function.array-filter.php i dont really see how that gets him the answer without at least checking the number of elements in the array after filtering it w/ array_filter; which if he wanted to reuse in several places would make sense to write a simple function for anyway.. function isSomethingInArray($array) { if(count(array_filter($array)) > 0) { return true; } else { return false; } } -nathan
Re: [PHP] check if any element of an array is not "empty"
yup! that's the one :D thanks richard Richard Heyes wrote: >> but I was thinking if there is the function does that. > > array_filter(). Note this: > > "If no callback is supplied, all entries of input equal to FALSE (see > converting to boolean) will be removed." > > http://uk3.php.net/manual/en/function.array-filter.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] check if any element of an array is not "empty"
but I was thinking if there is the function does that. array_filter(). Note this: "If no callback is supplied, all entries of input equal to FALSE (see converting to boolean) will be removed." http://uk3.php.net/manual/en/function.array-filter.php -- Richard Heyes ++ | Access SSH with a Windows mapped drive | |http://www.phpguru.org/sftpdrive| ++ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] check if any element of an array is not "empty"
On Wed, Apr 30, 2008 at 2:36 PM, afan pasalic <[EMAIL PROTECTED]> wrote: > hi, > as a result of one calculation I'm receiving an array where elements > could be 0 or date (as string -mm-dd hh:ii:ss). > I have to check if any of elements of the array is "date" or if all > elements of the array is 0? > > If I try array_sum($result) I'll get 0 no matter what (0 + $string = 0). > > I know I can do something like: > foreach($result as $value) > { >if ($value !=0) >{ > $alert = true; >} > } > > or > > if (in_array($result, '-')) > { >$alert = true; > } > > > but I was thinking if there is the function does that. i don think theres a function for that; and to be performance conscience, if just one occurrence of a date is all you need to know its not all 0's then break out of the loop once youve found that. foreach($result as $value) { if ($value !== 0) { $alert = true; break; } } -nathan
[PHP] check if any element of an array is not "empty"
hi, as a result of one calculation I'm receiving an array where elements could be 0 or date (as string -mm-dd hh:ii:ss). I have to check if any of elements of the array is "date" or if all elements of the array is 0? If I try array_sum($result) I'll get 0 no matter what (0 + $string = 0). I know I can do something like: foreach($result as $value) { if ($value !=0) { $alert = true; } } or if (in_array($result, '-')) { $alert = true; } but I was thinking if there is the function does that. thanks for any help. -afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 5 and mysql failure
On Wed, Apr 30, 2008 at 2:31 AM, Yehudi Alexis Garrett <[EMAIL PROTECTED]> wrote: > I'm using a php script which performs three xml queries to other three > servers to retrieve a set of ids and after I do a query to mysql of the kind > SELECT * FROM table WHERE id IN ('set of ids'); > Although I'm sure the connection to the database is ok, I sometimes get an > error of this kind: > *Warning*: mysql_fetch_object(): supplied argument is not a valid MySQL > result resource in ... > This does not happen every time i run the script, only sometimes. > If I echo the query, copy and paste in phpmyadmin, or if I perform the > same query in a script that does only the query without the rest it works! > After troubleshooting this issue I noticed that it usually failed when I > had a big set of ids (positive response from more than one server). This > means that the script used a bigger amount of memory and probably more > resources, but I did not get an "out of memory error", I got the one > described bfore. > My question is, is there any kind of limit somewhere in php5 or in mysql? > Thanks for help, > > YEHUDI GARRETT > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Have you tried output your SQL query and pasting it into mysql to see if it runs? Sounds to me like it isn't a valid query, that would give you that error. You may also want to put some row count checking prior to trying to fetch any rows. -- -Dan Joseph "Build a man a fire, and he will be warm for the rest of the day. Light a man on fire, and will be warm for the rest of his life."
[PHP] Re: php 5 and mysql failure
Yehudi Alexis Garrett wrote: I'm using a php script which performs three xml queries to other three servers to retrieve a set of ids and after I do a query to mysql of the kind SELECT * FROM table WHERE id IN ('set of ids'); Although I'm sure the connection to the database is ok, I sometimes get an error of this kind: *Warning*: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in ... This does not happen every time i run the script, only sometimes. If I echo the query, copy and paste in phpmyadmin, or if I perform the same query in a script that does only the query without the rest it works! After troubleshooting this issue I noticed that it usually failed when I had a big set of ids (positive response from more than one server). This means that the script used a bigger amount of memory and probably more resources, but I did not get an "out of memory error", I got the one described bfore. My question is, is there any kind of limit somewhere in php5 or in mysql? Thanks for help, YEHUDI GARRETT Are you sure that you always pass one or more ids into the query and that at least one of those ids exist in the db? -Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fun with SOAP.
On Wed, Apr 30, 2008 at 1:53 PM, Larry Brown < [EMAIL PROTECTED]> wrote: > Sorry no quick silver bullet, but I would highly recommend looking at > nusoap if only as a test. > additionally, i could not find any occurrence of 'attachment' grepping through the c code in the soap extension or the rpc extension.. -nathan
Re: [PHP] Fun with SOAP.
I'm not sure how it looks etc with with soapui but I noticed you mentioning you don't want to mess with nusoap. I've used nusoap for both client and server uses for years and I'm really impressed with how easily it works. Using $soapInstance->request and $soapInstance->response the xml is displayed where you can see how it was created based on the array you fed the instance before sending for your message. It makes troubleshooting much easier for me. That being said I don't send attachments. However just doing a quick google on "nusoap attachments" (without the quotes) has mention of people sending MIME attachments and one listing an issue with DIME encoded attachments yet another explaining that he solved the DIME encoded issue and referred to "wrox book open source webservices page 315" which is an on-line book. Sorry no quick silver bullet, but I would highly recommend looking at nusoap if only as a test. Larry On Wed, 2008-04-30 at 08:21 -0400, Eric Butera wrote: > On Wed, Apr 30, 2008 at 7:35 AM, Eric Butera <[EMAIL PROTECTED]> wrote: > > On Tue, Apr 29, 2008 at 5:07 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > > > i know this has nothing to do w/ getting it to work w/ php, eric, but > > have > > > you tried hitting the service w/ soap ui? > > > http://www.soapui.org/ > > > > > > although its written in java, its an indispensable testing tool, imho, > > and i > > > always give it a shot when im having soap troubles. i might try to see > > if > > > you can get a successful response from the service w/ it. > > > > > > -nathan > > > > Hi Nathan! > > > > Thanks for the reply. I'm download it as we speak. Hopefully it'll > > give me some sort of answer as to what is going on. I really haven't > > found out enough about the SOAP "standard" enough to know what is > > expected behavior, etc. I know I can see all of the raw data there, > > just ext/soap doesn't seem to like the multi-part. Maybe soapUI will > > give me some sort of answer for this. > > > > After using soapUI I've determined that the SOAP response gives back > an envelope and has one attachment. Does anyone know if the SOAP > extension can handle attachments? I'd really rather not mess around > with nusoap or the pear soap package. I don't see anywhere on the > manual where it is possible to download attachments. Hopefully > someone else has dealt with this before. > -- Larry Brown <[EMAIL PROTECTED]> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php 5 and mysql failure
I'm using a php script which performs three xml queries to other three servers to retrieve a set of ids and after I do a query to mysql of the kind SELECT * FROM table WHERE id IN ('set of ids'); Although I'm sure the connection to the database is ok, I sometimes get an error of this kind: *Warning*: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in ... This does not happen every time i run the script, only sometimes. If I echo the query, copy and paste in phpmyadmin, or if I perform the same query in a script that does only the query without the rest it works! After troubleshooting this issue I noticed that it usually failed when I had a big set of ids (positive response from more than one server). This means that the script used a bigger amount of memory and probably more resources, but I did not get an "out of memory error", I got the one described bfore. My question is, is there any kind of limit somewhere in php5 or in mysql? Thanks for help, YEHUDI GARRETT -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Xampp question, pretty much 0T
Alternatively, I suggest you look into VMWare. There are several free versions (player, server, etc) if you don't want Workstation (which I absolutely love!) Workstation will give you such life-savers as multiple Snapshots amongst other things. http://www.vmware.com/products/player/ http://www.vmware.com/products/ws/ http://www.vmware.com/products/server/ Then you can setup a LAMP VM with your favorite distro (I use Gentoo myself, but don't recommend it for a VM as the compilation all the time is painful). You can download some already setup and ready to go. http://www.vmware.com/appliances/directory/cat/53 This is how I do all my development. I run XP as my host OS. VMware is NAT. Setup SAMBA & ssh on the VM and don't forget to edit your "C:\WINDOWS\system32\drivers\etc\hosts" with an entry to point to your VM's virtual host(s): 192.168.222.128 askeet 192.168.222.128 askeet.LAMP.com And your /etc/apache2/vhosts.d/askeet.conf DocumentRoot "/home/sfprojects/askeet/web" ServerName askeet.LAMP.com ServerAlias askeet.LAMP.com askeet ErrorLog logs/askeet-error_log CustomLog logs/askeet-access_log common DirectoryIndex index.php Alias /sf /usr/share/php/data/symfony/web/sf AllowOverride All Options FollowSymLinks +Indexes Order allow,deny Allow from all AllowOverride All Options FollowSymLinks +Indexes Order allow,deny Allow from all Then you just go to http://askeet.LAMP.com in your XP host and you're hitting your VM LAMP virtual host. Add this to your /etc/samba/smb.conf file: [askeet] comment = askeet symphony development VMWare path = /home/sfprojects/askeet read only = no public = yes create mode = 0666 directory mode = 0777 force user = daevid WIN+R and \\askeet and you'll connect to that directory to start coding in your favorite PHP editor. Works like a f'n champ! :D I'll also suggest SQLYog and SecureCRT as my two other tools I just can't do without. Daevid Vincent http://daevid.com > -Original Message- > From: Wolf [mailto:[EMAIL PROTECTED] > Sent: Wednesday, April 30, 2008 6:06 AM > To: Ryan S; php php > Subject: RE: [PHP] Xampp question, pretty much 0T > > Top posting from my cell... > > 1. Format hard drive > 2. Install redhat fc8 or Ubuntu 8.04 > 3. Load the new MySQL installation with your backup file > > If you really have to stay with windoze, remove and re-install apache. > Look at the system log files as they SHOULD tell you what was causing > the crash. > > -Original Message- > From: Ryan S <[EMAIL PROTECTED]> > Sent: Tuesday, April 29, 2008 6:26 PM > To: php php > Subject: [PHP] Xampp question, pretty much 0T > > > Hello! > > I have been using XAMPP for quite some time now (thanks to the > recommendations from this list) without any real complaints... > and the only reason I am writing here is because i am sure a lot of you > guys run the same thing considering the amount of people who > recommended it to me when I asked for an easy install of AMP. > It was easy to install and has given me months of hassle free use... > but today i have started facing some strange problems of everytime I > start Apache.. it crashes my laptop, anybody else run into this? > I use this only for PHP, no perl. > > My config: > Win Vista home premium with all updates and patches (genuine, not > pirate copy) > core2 duo 2ghz > 2 gigs ram > > Nothing installed today for it to be acting up so. > > Do you suggest I reinstall? or can I just reinstall Apache in some way? > If i have to reinstall is there an easy way of backing up my stuff and > then reinstalling then putting my stuff back? (I know i can just copy > the files that were in the htdocs... but am talking about an easy way > to copy the files and the DBs and put them back... or is that just > wishful thinking? > > TIA, > Ryan > > > > > -- > - The faulty interface lies between the chair and the keyboard. > - Creativity is great, but plagiarism is faster! > > > [The entire original message is not included] > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best practices for using MySQL index
On Wed, 2008-04-30 at 11:14 +0200, Aschwin Wesselius wrote: > Shelley wrote: > > Hi all, > > > > I am currently responsible for a subscription module and need to design the > > DB tables and write code. > > > > I have described my table design and queries in the post: > > http://phparch.cn/index.php/mysql/38-MySQL-configuration/152-best-practices-for-using-mysql-index > > > > The problem is, in a short time the table will hold millions of records. > > So the query and index optimization is very important. > > > > Any suggestion will be greatly appreciated. > Hi, > > While this is not a MySQL mailing list, I try to give you some hints and > keep it short. > > Index on most integer fields only. Text fields can be indexed, but is > not important when you design your DB well. Could you describe a well designed DB that contains searchable text that doesn't contain a text index... fulltext or otherwise. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Xampp question, pretty much 0T
Top posting from my cell... 1. Format hard drive 2. Install redhat fc8 or Ubuntu 8.04 3. Load the new MySQL installation with your backup file If you really have to stay with windoze, remove and re-install apache. Look at the system log files as they SHOULD tell you what was causing the crash. -Original Message- From: Ryan S <[EMAIL PROTECTED]> Sent: Tuesday, April 29, 2008 6:26 PM To: php php Subject: [PHP] Xampp question, pretty much 0T Hello! I have been using XAMPP for quite some time now (thanks to the recommendations from this list) without any real complaints... and the only reason I am writing here is because i am sure a lot of you guys run the same thing considering the amount of people who recommended it to me when I asked for an easy install of AMP. It was easy to install and has given me months of hassle free use... but today i have started facing some strange problems of everytime I start Apache.. it crashes my laptop, anybody else run into this? I use this only for PHP, no perl. My config: Win Vista home premium with all updates and patches (genuine, not pirate copy) core2 duo 2ghz 2 gigs ram Nothing installed today for it to be acting up so. Do you suggest I reinstall? or can I just reinstall Apache in some way? If i have to reinstall is there an easy way of backing up my stuff and then reinstalling then putting my stuff back? (I know i can just copy the files that were in the htdocs... but am talking about an easy way to copy the files and the DBs and put them back... or is that just wishful thinking? TIA, Ryan -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! [The entire original message is not included] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Xampp question, pretty much 0T
> After reading a bit I see that if I just copy the "data" directory in the > mySql directory, I can restore it from there? any idea if I have that wrong? Hmm I guess, but I'd take the safer road and open a console and run: mysqldump.exe -u -p --all-databases --add-drop-database --opt > mysql.database.dump so you have an sql file you can restore if necessary. Adjust paths/files/usernames/passwords as necessary. Hey! Thanks for replying. I decided to try something else while waiting for a response (still nothing from the main XAMPP forums though) and this is what worked for me, am posting it here so maybe it will help someone else in future (via the archives) facing the same problems that I faced , I dont know if this is a temp fix, I dont think so and it works perfectly for now. Downloaded XAMPP again, installed it in c:/xampp2 (original version was in c:/xampp) copied over all the files needed from the htdocs to c:/xampp2's htdocs in the MySql folder, go into the "data" folder and just copy the files with the DB names that you created, leave all other files alone, paste these files into the c:/xampp2/mysql/data folder... do not overwrite anything, and if you have done this correctly you should _not_ get the overwrite prompt Go to xampp's security page and redo the security including putting the password for root.. I am a bit of a paranoid dude, so i did a complete backup of all myfiles in htdocs and the mySql data folder and burnt it to DVD, you might consider doing thesame...just in case. Thats it! Remember to edit the paths in your scripts for those that need it from xampp to xampp2. A slight hassle, but not one that cant be done in 3-10 mins including copy time. Thanks again Chris for your replies to this thread. Cheers! R Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fun with SOAP.
On Wed, Apr 30, 2008 at 7:35 AM, Eric Butera <[EMAIL PROTECTED]> wrote: > On Tue, Apr 29, 2008 at 5:07 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > > i know this has nothing to do w/ getting it to work w/ php, eric, but have > > you tried hitting the service w/ soap ui? > > http://www.soapui.org/ > > > > although its written in java, its an indispensable testing tool, imho, and > i > > always give it a shot when im having soap troubles. i might try to see if > > you can get a successful response from the service w/ it. > > > > -nathan > > Hi Nathan! > > Thanks for the reply. I'm download it as we speak. Hopefully it'll > give me some sort of answer as to what is going on. I really haven't > found out enough about the SOAP "standard" enough to know what is > expected behavior, etc. I know I can see all of the raw data there, > just ext/soap doesn't seem to like the multi-part. Maybe soapUI will > give me some sort of answer for this. > After using soapUI I've determined that the SOAP response gives back an envelope and has one attachment. Does anyone know if the SOAP extension can handle attachments? I'd really rather not mess around with nusoap or the pear soap package. I don't see anywhere on the manual where it is possible to download attachments. Hopefully someone else has dealt with this before. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fun with SOAP.
On Wed, Apr 30, 2008 at 2:53 AM, Warren Vail <[EMAIL PROTECTED]> wrote: > You should be able to parse it manually in PHP, but probably not with a XML > parser or reader. Simply var_dump() the responses you are getting and write > the code to break it up into values you can use. In some respects I've > found this easier than XML, which tends at times to be somebody else's idea > of a standard XML response ;-). > > Warren I hear that! I had a thought of creating a subclass for the SOAP client to pre-filter the results for document fetching so that I can just grab the last multipart chunk myself & use SimpleXML on it. I was just hoping there was some way of getting ext/soap to understand that it is a multipart response and somehow tell it to use part 3. Thank you for your reply! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fun with SOAP.
On Tue, Apr 29, 2008 at 5:07 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > i know this has nothing to do w/ getting it to work w/ php, eric, but have > you tried hitting the service w/ soap ui? > http://www.soapui.org/ > > although its written in java, its an indispensable testing tool, imho, and i > always give it a shot when im having soap troubles. i might try to see if > you can get a successful response from the service w/ it. > > -nathan Hi Nathan! Thanks for the reply. I'm download it as we speak. Hopefully it'll give me some sort of answer as to what is going on. I really haven't found out enough about the SOAP "standard" enough to know what is expected behavior, etc. I know I can see all of the raw data there, just ext/soap doesn't seem to like the multi-part. Maybe soapUI will give me some sort of answer for this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best practices for using MySQL index
Shelley wrote: Don't index just all integer fields. Keep track of the cardinality of a column. If you expect a field to have 100.000 records, but with only 500 distinct values it has no use to put an index on that column. A full record search is quicker. Hmmm... That's new. :) Well, to give you a good measure: keep the cardinality between 30 to 70-80 percent of your total records in a column. But sometimes your field is NULL or empty, so it really depends. You can't just put it into a standard configuration. And it also really depends on how many records a table contains etc. Besides that, benchmarking your development environment (you do have one do you?) can gives you a good idea on how your hardware and setup performs. Aschwin Wesselius
Re: [PHP] Best practices for using MySQL index
On Wed, Apr 30, 2008 at 5:14 PM, Aschwin Wesselius <[EMAIL PROTECTED]> wrote: > Shelley wrote: > > > Hi all, > > > > I am currently responsible for a subscription module and need to design > > the > > DB tables and write code. > > > > I have described my table design and queries in the post: > > > > http://phparch.cn/index.php/mysql/38-MySQL-configuration/152-best-practices-for-using-mysql-index > > > > The problem is, in a short time the table will hold millions of records. > > So the query and index optimization is very important. > > > > Any suggestion will be greatly appreciated. > > > Hi, > > While this is not a MySQL mailing list, I try to give you some hints and > keep it short. > > Index on most integer fields only. Text fields can be indexed, but is not > important when you design your DB well. > > Don't index just all integer fields. Keep track of the cardinality of a > column. If you expect a field to have 100.000 records, but with only 500 > distinct values it has no use to put an index on that column. A full record > search is quicker. Hmmm... That's new. :) > > > Put the columns with the highest cardinality as the first keys, since > MySQL will find these if no index is explicitly given. > > You can look at an index with "SHOW INDEX FROM table" and this gives you a > column "cardinality". > > Try out your select statements and use "EXPLAIN SELECT FROM > table" and use some joins on other tables. This will show you which possible > indexes are found and which one is being used for that query. You can > sometimes force or ignore an index being used like this "SELECT > FROM table USE INDEX (userID)". Try the MySQL manual for more options. But > do use the "EXPLAIN" statement to have a close look on the use of indexes > and the use of sorting methods. Because both are important. Having a good > index, but a slow sorting method won't get you good results. > > I hope this is a good short hint on using indexes. Yes. It is. > But becoming a master does not come over night. Try the website > www.mysqlperformanceblog.com for more good solid tips on these topics. Good link. Thanks. > > > Aschwin Wesselius > -- Regards, Shelley
Re: [PHP] Best practices for using MySQL index
Shelley wrote: Hi all, I am currently responsible for a subscription module and need to design the DB tables and write code. I have described my table design and queries in the post: http://phparch.cn/index.php/mysql/38-MySQL-configuration/152-best-practices-for-using-mysql-index The problem is, in a short time the table will hold millions of records. So the query and index optimization is very important. Any suggestion will be greatly appreciated. Hi, While this is not a MySQL mailing list, I try to give you some hints and keep it short. Index on most integer fields only. Text fields can be indexed, but is not important when you design your DB well. Don't index just all integer fields. Keep track of the cardinality of a column. If you expect a field to have 100.000 records, but with only 500 distinct values it has no use to put an index on that column. A full record search is quicker. Put the columns with the highest cardinality as the first keys, since MySQL will find these if no index is explicitly given. You can look at an index with "SHOW INDEX FROM table" and this gives you a column "cardinality". Try out your select statements and use "EXPLAIN SELECT FROM table" and use some joins on other tables. This will show you which possible indexes are found and which one is being used for that query. You can sometimes force or ignore an index being used like this "SELECT FROM table USE INDEX (userID)". Try the MySQL manual for more options. But do use the "EXPLAIN" statement to have a close look on the use of indexes and the use of sorting methods. Because both are important. Having a good index, but a slow sorting method won't get you good results. I hope this is a good short hint on using indexes. But becoming a master does not come over night. Try the website www.mysqlperformanceblog.com for more good solid tips on these topics. Aschwin Wesselius -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP debugger
NOTE: If you are interesting in PHP Debuggers, this is not the mail, check the start of the thread since after I decided to try JasonPruim Debug :p we are trying to solve one specific problem. Now, to who is following the thread ... don't hung me, but i think the problem was there was because there was no permission to write in a logfile. ---> BEGIN failed--compilation aborted at /home/httpd/bin/esnic/whois.pl line 9. line9 = use EPP::Client; right at Client.pm there is the declaration og the log file. My inexcusable big mistake, don't check the logs before, in fact i saw it yesterday looking for other thing. But since running the sccript from command line there was no error... I didn't realise to check them :-/ Now it works :) Thank you very much for following and assistance. Edward Kay escribió: -Original Message- From: Jason Pruim [mailto:[EMAIL PROTECTED]] Morning, So looking at those scripts I realized that perl is nothing like php ;) Is there other info that the different places need? or is it just a different URL? I'm wondering why you could do something like: HTTP://www.myCool.es/?query="$nom.$ext"; break; case 'eu'; $cmd = HTTP://www.myCool.eu/?query="$nom.ext"; break; default; $cmd = HTTP://www.whois.com/?query="$nom.ext"; break; } ?> instead of calling out to a different script? Also, I noticed that in your script where you have "default:" in your switch, you have a : instead of a ; Actually, the colon is correct: http://uk.php.net/switch You also need to enclose your string declarations correctly and add the $ before ext, e.g. $cmd = "http://www.whois.com/?query=$nom.$ext"; or $cmd = 'http://www.whois.com/?query='.$nom.'.'.$ext; Edward --
Re: [PHP] web based chat app
On Wed, Apr 30, 2008 at 4:28 PM, paragasu <[EMAIL PROTECTED]> wrote: > You want light outta it?use the jabber2 server as a backend. It'll be > > done > > serving while you try to access the database. No need to do a square > > wheel, > > when a round one is invented > > > is there any free jabber2 server i can use? > > i found the jabber2 main project website. but it is not suitable for what i wan't coz i want to integrate the chat to my website. so online member can chat to each other. i see a perl implementation but no php..
Re: [PHP] web based chat app
> > You want light outta it?use the jabber2 server as a backend. It'll be > done > serving while you try to access the database. No need to do a square > wheel, > when a round one is invented is there any free jabber2 server i can use?
[PHP] Sending data to PS
Hi List In Perl it is possible to use the syntax $0 = "$LISTENER: accepting connections on $SERVER_PORT"; to set a meaningful test string for ps. Is such a thing, or anything similar, available for PHP? Regards, Richard Luckhurst -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Graphical Site Map
Hi Folks, Does anybody know of a product (php or otherwise) that enables the creation of a graphical site map ? I have had a shimmy around the web but just keep finding classes to create the .xml format site maps. TIA, JC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php