Re: [PHP-DB] MySQL and BLOB
maybe RTFM is not the answer!!! i think this will help a little more http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#Sto rage_requirements greet Martin - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, August 22, 2002 8:17 AM Subject: Re: [PHP-DB] MySQL and BLOB > On Thursday 22 August 2002 13:57, Andy wrote: > > > Hi there, > > > > I am storing via PHP pictures into BLOB fields. Worked fine so far for over > > 200 images. > > Now an error has occured with a particular picture. No error msg. Just does > > not work. The wired thing is that the thumbnail does. So I guess the BLOB > > field is just to small for the image. > > > > How many kb can a blob field savin in MySQL > > Depends on what type of BLOB. Why don't you RFTM? > > > and what do you suggest to do. > > Probably the usual, not to store files in MySQL where possible. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > > /* > Never buy from a rich salesman. > -- Goldenstern > */ > > > -- > 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] MySQL and BLOB
On Thursday 22 August 2002 13:57, Andy wrote: > Hi there, > > I am storing via PHP pictures into BLOB fields. Worked fine so far for over > 200 images. > Now an error has occured with a particular picture. No error msg. Just does > not work. The wired thing is that the thumbnail does. So I guess the BLOB > field is just to small for the image. > > How many kb can a blob field savin in MySQL Depends on what type of BLOB. Why don't you RFTM? > and what do you suggest to do. Probably the usual, not to store files in MySQL where possible. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Never buy from a rich salesman. -- Goldenstern */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] MySQL and BLOB
Hi there, I am storing via PHP pictures into BLOB fields. Worked fine so far for over 200 images. Now an error has occured with a particular picture. No error msg. Just does not work. The wired thing is that the thumbnail does. So I guess the BLOB field is just to small for the image. How many kb can a blob field savin in MySQL and what do you suggest to do. Thanx, Andy -- -- http://www.globosapiens.net Worldwide Travel Community -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
On Thursday 22 August 2002 04:01, [EMAIL PROTECTED] wrote: > Got it figured out, and foreign address do work now - > if (empty($useremail) || > !eregi("^([A-Za-z0-9\.\_-])+@([A-Za-z0-9\_-])+\.([A-Za-z])+\.([a-z])*$", > $useremail)) What do you mean by 'foreign' addresses? The above will still fail for: [EMAIL PROTECTED] -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Dungeons and Dragons is just a lot of Saxon Violence. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Date Subtraction
What's more you can do some neat stuff with manipulating the timestamp to create very quick and accurate calendars. For instance for an application I had to build I had need of highlighting weeks on a calendar to change colors every two weeks, but any given day needed to know which color it should show. Since the increment of the timestamp is so predictible you can use the mod operator and do all kinds of neat stuff. Anyway, just another 2 cents worth. <>< Ryan -Original Message- From: Manoj Japher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 1:04 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Date Subtraction hi, hey you are bang on target. It did solve my problem. Thanks a lot, Manoj On Wed, 21 Aug 2002 [EMAIL PROTECTED] wrote : > >if you really just want yesterday, i use date("Y-m-d", time() - 86400); > >that way you'll get the correct info, no matter if it spans >weeks, months, >years etc > >i realize there could be flaws with this b/c it just subtracts 24hours, but >it works > > > > "Manoj Japher" > fmail.com> cc: > Subject: >[PHP-DB] Date Subtraction > 08/21/2002 02:23 > PM > Please respond to > "Manoj Japher" > > > > > > >hi, > Is there any way I can get previous day's date, like we get >current >date by using getdate() or date() function. I mean is there >some >in-built function in PHP which can subtract date to give me >yesterday's date. > I am currently calculating it using some code, which I have >written >and it is very tirng and recursive to check for each possible >case. > > If someone has solved this before pls let me know. > >Thanks, > >Regards, > >Manoj > > >'I have miles to go before I sleep, and promises to keep' > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > > 'I have miles to go before I sleep, and promises to keep' -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Date Subtraction
Use getdate() with mktime() and this is your solution. http://www.php.net/manual/en/function.getdate.php http://www.php.net/manual/en/function.mktime.php Adam
[PHP-DB] Re: gd Library config problem.......
Try asking in php.general. I use debian so it was easy for me to setup my PHP4 with all I needed :) -Joni- -- // Joni Järvinen // [EMAIL PROTECTED] // http://www.reactorbox.org/~wandu "Dan Kelly" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Anyone know how to configure gd library (php4)? I uploaded PHP_INFO and > this is what I got > > ~~~ > './configure' '--with-apxs=apxs' > '--prefix=/home/builder/psa-patch/psa/apache/../release/usr/local/psa/apache ' > '--with-system-regex' > '--with-config-file-path=/usr/local/psa/apache/conf' '--disable-debug' > '--disable-pear' '--enable-sockets' '--enable-track-vars' '--without-gd' > '--with-mysql=/home/builder/psa-patch/psa/apache/../release/dist/usr/local/p sa/mysql' > '--with-iodbc=/home/builder/psa-patch/psa/apache/../release/lib/libiodbc' > '--with-imap=/home/builder/psa-patch/psa/apache/../release/lib/imap-cclient' > > Notice that it says "Without GD" I want it to say "With gd" .. where di > I go to fix this problem? > Thanks, Dan > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
There is this cute suggestion in the Wrox PHP book: /^.+@.+\\..+$/ Looks like a puzzle, but it works (almost) always. Enjoy Ignatius Reilly - Original Message - From: DL Neil To: [EMAIL PROTECTED] ; [EMAIL PROTECTED] Sent: Wednesday, August 21, 2002 10:04 PM Subject: Re: [PHP-DB] form validation question - regex not working Regarding the problem you are actually asking about: > > > if (empty($useremail) || !eregi("^([A-Za-z0-9\.\_-])+@([A-Za-z0-9\_-]) > +\. > > > ([A-Za-z]{2,3})+$", $useremail)) > > Notice the {2,3} which is supposed to limit the last part to 2 or 3 > > letters, but I have been testing this and > > it allows as many letters as I put in there, but not 1 only. > > What's wrong? Please be aware that I use PCRE not POSIX, but IIRC the last phrase says: ([A-Za-z]{2,3})+$ any upper or lower case letter, repeated twice or three times, and that appearing zero or more times, !!!??? appearing at the end of the string. Remove the + immediately before the terminating $. Regards, =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
Regarding the problem you are actually asking about: > > > if (empty($useremail) || !eregi("^([A-Za-z0-9\.\_-])+@([A-Za-z0-9\_-]) > +\. > > > ([A-Za-z]{2,3})+$", $useremail)) > > Notice the {2,3} which is supposed to limit the last part to 2 or 3 > > letters, but I have been testing this and > > it allows as many letters as I put in there, but not 1 only. > > What's wrong? Please be aware that I use PCRE not POSIX, but IIRC the last phrase says: ([A-Za-z]{2,3})+$ any upper or lower case letter, repeated twice or three times, and that appearing zero or more times, !!!??? appearing at the end of the string. Remove the + immediately before the terminating $. Regards, =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
Regarding the good sense or otherwise for checking email addresses: > This is from a php/mysql book... If it was from page 115, then please turn over to page 116! Regards, =dn -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
Jason Wong <[EMAIL PROTECTED]> wrote on 08/21/2002 12:10:02 PM: > It's only checking for addresses of the form [EMAIL PROTECTED] > As you can see, the list address ([EMAIL PROTECTED]), and my address > ([EMAIL PROTECTED]) would be treated as invalid. Not very clever is it? Got it figured out, and foreign address do work now - if (empty($useremail) || !eregi("^([A-Za-z0-9\.\_-])+@([A-Za-z0-9\_-])+\.([A-Za-z])+\.([a-z])*$", $useremail)) -- Chip -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
On Thu, 22 Aug 2002 03:10:02 +0800 Jason Wong <[EMAIL PROTECTED]> wrote: > On Thursday 22 August 2002 02:54, [EMAIL PROTECTED] wrote: > As you can see, the list address ([EMAIL PROTECTED]), and my address > ([EMAIL PROTECTED]) would be treated as invalid. Not very clever is it? Well, anyway there is only one sure way to valid email, confirmation message :-) pa -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
On Thursday 22 August 2002 02:54, [EMAIL PROTECTED] wrote: > This is from a php/mysql book. If they're presenting it as something that you can use in your real-life code then you should look carefully at all the other code in the book to see whether they're all as sloppy. On the other hand if they're only presenting it as an example on using regex then it's fine for learning with. > I added the parenthesis simply to group the > sections, and added the {2,3} because a web site tutorial shows that will > limit the preceding section to that many characters (2 or 3 only in this > case). > The script works fine without the {2,3}, and I may have to use it that way, > since another response mentioned foreign addresses, I hadn't taken into > account. > I'd just like to know why it doesn't work, becuase the it's supposed to. It's only checking for addresses of the form [EMAIL PROTECTED] As you can see, the list address ([EMAIL PROTECTED]), and my address ([EMAIL PROTECTED]) would be treated as invalid. Not very clever is it? -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* "His great aim was to escape from civilization, and, as soon as he had money, he went to Southern California." */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Re: problem with php and unixODBC
Marten, Look at the output of a phpinfo() when you have the putenv()'s - you can see that there are a couple of different environments here. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Virtuoso Universal Server -Original Message- From: Marten Lehmann [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 14, 2002 4:59 AM To: Nick Gorham Cc: [EMAIL PROTECTED] Subject: [PHP-DB] Re: problem with php and unixODBC Hello, > I know its a little late, but I have only just been pointed to your > posting, I would guess the error you are getting "database not found" is > coming from the sybase driver, not the driver manager. I solved the problem a week ago. It was just when I wanted to try iODBC when I saw some putenv()-lines in the examples. I put the appropriate lines in my php-script and then it worked. What I don't unterstand is: When I'm running isql in the shell I can connect to the remote-ressource. When I start apache in the same shell I can't connect through PHP, I first have to set the ODBCINSTINI and ODBCINI env-variables. Why don't I need them in the shell? Regards Marten -- Variomedia IT-Service GmbH | Benzstrasse 22 | 14482 Potsdam http://www.variomedia.de | Hotline: 0800-5588550 | Fax: 0331-7404043 -- 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: Re: [PHP-DB] Date Subtraction
hi, hey you are bang on target. It did solve my problem. Thanks a lot, Manoj On Wed, 21 Aug 2002 [EMAIL PROTECTED] wrote : > >if you really just want yesterday, i use date("Y-m-d", time() - 86400); > >that way you'll get the correct info, no matter if it spans >weeks, months, >years etc > >i realize there could be flaws with this b/c it just subtracts 24hours, but >it works > > > > "Manoj Japher" > fmail.com> cc: > Subject: >[PHP-DB] Date Subtraction > 08/21/2002 02:23 > PM > Please respond to > "Manoj Japher" > > > > > > >hi, > Is there any way I can get previous day's date, like we get >current >date by using getdate() or date() function. I mean is there >some >in-built function in PHP which can subtract date to give me >yesterday's date. > I am currently calculating it using some code, which I have >written >and it is very tirng and recursive to check for each possible >case. > > If someone has solved this before pls let me know. > >Thanks, > >Regards, > >Manoj > > >'I have miles to go before I sleep, and promises to keep' > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > > 'I have miles to go before I sleep, and promises to keep' -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Date Subtraction
Oh, in MySQL, there's also DATE_SUB(). Forgot to mention that one. Rich -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 2:40 PM To: 'Manoj Japher'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] Date Subtraction Manoj, Just a couple of thoughts: First, I know this particular topic has been discussed here recently, so you might want to search the archives for more exhaustive information. Second, if you're using MySQL, check out the functions DATE_ADD() and MOD(). They're MySQL functions, so you'll have to implement them in your query, not the actual PHP code itself. These may or may not give you what you're looking for. You might have to drop the value of some kind of PHP variable into the DATE_ADD() INTERVAL parameter or something though. I looked quickly through the date functions in the PHP documentation and didn't find anything that would really manipulate the date for you (of course I may have missed it). The one thing that I did notice is that the PHP date and time functions return the SERVER date and time to you, not the local time for the user accessing your page. That might not be what you want. As I said before, I might have missed something, but that's what I found out after looking for all of two minutes. Rich -Original Message- From: Manoj Japher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 2:23 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Date Subtraction hi, Is there any way I can get previous day's date, like we get current date by using getdate() or date() function. I mean is there some in-built function in PHP which can subtract date to give me yesterday's date. I am currently calculating it using some code, which I have written and it is very tirng and recursive to check for each possible case. If someone has solved this before pls let me know. Thanks, Regards, Manoj 'I have miles to go before I sleep, and promises to keep' -- 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] Date Subtraction
On Thursday 22 August 2002 02:23, Manoj Japher wrote: > hi, > Is there any way I can get previous day's date, like we get > current > date by using getdate() or date() function. I mean is there some > in-built function in PHP which can subtract date to give me > yesterday's date. > I am currently calculating it using some code, which I have > written > and it is very tirng and recursive to check for each possible > case. > > If someone has solved this before pls let me know. mktime() -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* The person who makes no mistakes does not usually make anything. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
Jason Wong <[EMAIL PROTECTED]> wrote on 08/21/2002 10:00:23 AM: > On Thursday 22 August 2002 00:29, [EMAIL PROTECTED] wrote: > > I hope this isn't too far off topic - > > > > I have a regex for validating email addresses - > > > > if (empty($useremail) || !eregi("^([A-Za-z0-9\.\_-])+@([A-Za-z0-9\_-]) +\. > > ([A-Za-z]{2,3})+$", $useremail)) > > > > Notice the {2,3} which is supposed to limit the last part to 2 or 3 > > letters, but I have been testing this and > > it allows as many letters as I put in there, but not 1 only. > > What's wrong? > > Also, when using eregi do I need to specify A-Za-z or just a-z, since it is > > case-insensitive? > You're strongly advised not to write your own regex for validating email > addresses. Your regex (once you get it working) will invalidate a lot of > valid email addresses. Search archives, or google for some tried and tested > regex which will do the job properly. > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk This is from a php/mysql book. I added the parenthesis simply to group the sections, and added the {2,3} because a web site tutorial shows that will limit the preceding section to that many characters (2 or 3 only in this case). The script works fine without the {2,3}, and I may have to use it that way, since another response mentioned foreign addresses, I hadn't taken into account. I'd just like to know why it doesn't work, becuase the it's supposed to. -- Chip > /* > The most important things, each person must do for himself. > */ Interesting tag considering your respoonse that I shouldn't do this mysqlf, eh? :-) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Charts...
James. Many times I find myself wanting a quick and dirty bar chart using only HTML. You can do this simply by creating a one pixel image in any color you like. That way the download is only 1 pixel. Then calculate the width or height depending on if you want vertical or horizontal bars by placing the variable in the height or width and display the one pixel image as such: echo ""; You can stack different colors. But you only get bar graphs. HTH. Dan. James Hatridge wrote: > Hi all.. > > I'm using SuSE 8.0, mysql, and PHP4. Is it possible to make charts with a > database? If so, how about a hint on it? > > Thanks > > JIM -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] gd Library config problem.......
Anyone know how to configure gd library (php4)? I uploaded PHP_INFO and this is what I got ~~~ './configure' '--with-apxs=apxs' '--prefix=/home/builder/psa-patch/psa/apache/../release/usr/local/psa/apache' '--with-system-regex' '--with-config-file-path=/usr/local/psa/apache/conf' '--disable-debug' '--disable-pear' '--enable-sockets' '--enable-track-vars' '--without-gd' '--with-mysql=/home/builder/psa-patch/psa/apache/../release/dist/usr/local/psa/mysql' '--with-iodbc=/home/builder/psa-patch/psa/apache/../release/lib/libiodbc' '--with-imap=/home/builder/psa-patch/psa/apache/../release/lib/imap-cclient' Notice that it says "Without GD" I want it to say "With gd" .. where di I go to fix this problem? Thanks, Dan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Date Subtraction
Manoj, Just a couple of thoughts: First, I know this particular topic has been discussed here recently, so you might want to search the archives for more exhaustive information. Second, if you're using MySQL, check out the functions DATE_ADD() and MOD(). They're MySQL functions, so you'll have to implement them in your query, not the actual PHP code itself. These may or may not give you what you're looking for. You might have to drop the value of some kind of PHP variable into the DATE_ADD() INTERVAL parameter or something though. I looked quickly through the date functions in the PHP documentation and didn't find anything that would really manipulate the date for you (of course I may have missed it). The one thing that I did notice is that the PHP date and time functions return the SERVER date and time to you, not the local time for the user accessing your page. That might not be what you want. As I said before, I might have missed something, but that's what I found out after looking for all of two minutes. Rich -Original Message- From: Manoj Japher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 21, 2002 2:23 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Date Subtraction hi, Is there any way I can get previous day's date, like we get current date by using getdate() or date() function. I mean is there some in-built function in PHP which can subtract date to give me yesterday's date. I am currently calculating it using some code, which I have written and it is very tirng and recursive to check for each possible case. If someone has solved this before pls let me know. Thanks, Regards, Manoj 'I have miles to go before I sleep, and promises to keep' -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Date Subtraction
hi, Is there any way I can get previous day's date, like we get current date by using getdate() or date() function. I mean is there some in-built function in PHP which can subtract date to give me yesterday's date. I am currently calculating it using some code, which I have written and it is very tirng and recursive to check for each possible case. If someone has solved this before pls let me know. Thanks, Regards, Manoj 'I have miles to go before I sleep, and promises to keep' -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
Jason, Concur with your advice, but was also amused by its juxtaposition with your sig file philosophy... =dn [snipped] > > I have a regex for validating email addresses - > You're strongly advised not to write your own regex for validating email > /* > The most important things, each person must do for himself. > */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Charts...
AFAI, to make really nice, Excel-style, dynamical charts, the best way is to export your MySQL data into a SVG string (a XML document), which can be viewed directly by the client browser (at least with IE5+) Someday MySQL will have a SELECT ... OUTPUT XML capability... I am currently looking for SVG templates for making dynamical plot and line charts; I haven't found much on the web. Can anyone help? Thanks Ignatius Reilly - Original Message - From: James Hatridge To: PHP_DB Sent: Wednesday, August 21, 2002 8:01 PM Subject: [PHP-DB] Charts... Hi all.. I'm using SuSE 8.0, mysql, and PHP4. Is it possible to make charts with a database? If so, how about a hint on it? Thanks JIM -- Jim Hatridge Linux User #88484 -- BayerWulf Linux System # 129656 The Recycled Beowulf Project Looking for throw-away or obsolete computers and parts to recycle into a Linux super computer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
On Thursday 22 August 2002 00:29, [EMAIL PROTECTED] wrote: > I hope this isn't too far off topic - > > I have a regex for validating email addresses - > > if (empty($useremail) || !eregi("^([A-Za-z0-9\.\_-])+@([A-Za-z0-9\_-])+\. > ([A-Za-z]{2,3})+$", $useremail)) > > Notice the {2,3} which is supposed to limit the last part to 2 or 3 > letters, but I have been testing this and > it allows as many letters as I put in there, but not 1 only. > What's wrong? > Also, when using eregi do I need to specify A-Za-z or just a-z, since it is > case-insensitive? You're strongly advised not to write your own regex for validating email addresses. Your regex (once you get it working) will invalidate a lot of valid email addresses. Search archives, or google for some tried and tested regex which will do the job properly. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* The most important things, each person must do for himself. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] form validation question - regex not working
Chip, It's not so much off topic as a perennial topic - see archives and many tutorial articles. When you've worked out the answer to this question, please try out your algorithm on my (or any other 'foreign') address. Then consider the imminent introduction of further TLDs, eg .info (four characters), .family, etc. Regards, =dn PS Sorry, can't help with POSIX RegExs - I confuse myself without any outside assistance using the PCRE variants. > I hope this isn't too far off topic - > > I have a regex for validating email addresses - > > if (empty($useremail) || !eregi("^([A-Za-z0-9\.\_-])+@([A-Za-z0-9\_-])+\. > ([A-Za-z]{2,3})+$", $useremail)) > > Notice the {2,3} which is supposed to limit the last part to 2 or 3 > letters, but I have been testing this and > it allows as many letters as I put in there, but not 1 only. > What's wrong? > Also, when using eregi do I need to specify A-Za-z or just a-z, since it is > case-insensitive? > > -- > Chip Wiegand > Computer Services > Simrad, Inc > www.simradusa.com > [EMAIL PROTECTED] > > "There is no reason anyone would want a computer in their home." > --Ken Olson, president, chairman and founder of Digital Equipment > Corporation, 1977 > (They why do I have 9? Somebody help me!) > > > -- > 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] Can't get data back into the database
Patrick Kirk said: Good Lord - its eaten contacts.php again! Contacts// >Contacts / ?grouping=> / First Name: Last Name: Organisation: Home Phone: Work Phone: Mobile Phone: Email: Title: Date of birth: Home Address: Work Address: Grouping: Club Players Archives Enterprise Business Children Partners Resources Personal Elizabeth Mews Notes: Contacts / $grouping / $first_name $last_name"; echo "Record updated/edited!"; } elseif ($delete) { // delete a record echo "Contacts / $grouping"; $sql = "DELETE FROM people WHERE person_id=$person_id"; $result = mysql_query($sql); echo "$sql Record deleted!"; } else { ?> Contacts Filter by Grouping: > Grouping: Club Players Archives Enterprise Business Children Partners Resources Personal Elizabeth Mews Contacts/$grouping"; echo "Contacts / $grouping"; echo " Add a New Contact "; echo "First Name Last Name Organisation Details"; $alternate = "2"; while ($row = mysql_fetch_array($result)) { $first_name = $row["first_name"]; $last_name = $row["last_name"]; $organisation = $row["organisation"]; $person_id = $row["person_id"]; if ($alternate == "1") { $color = "#A0B8C8"; $alternate = "2"; } else { $color = "#ff"; $alternate = "1"; } echo "$first_name $last_name $organisation More... "; } // echo ""; echo ""; } // Function printGrouping ?> -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] form validation question - regex not working
I hope this isn't too far off topic - I have a regex for validating email addresses - if (empty($useremail) || !eregi("^([A-Za-z0-9\.\_-])+@([A-Za-z0-9\_-])+\. ([A-Za-z]{2,3})+$", $useremail)) Notice the {2,3} which is supposed to limit the last part to 2 or 3 letters, but I have been testing this and it allows as many letters as I put in there, but not 1 only. What's wrong? Also, when using eregi do I need to specify A-Za-z or just a-z, since it is case-insensitive? -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com [EMAIL PROTECTED] "There is no reason anyone would want a computer in their home." --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (They why do I have 9? Somebody help me!) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Charts...
On Thursday 22 August 2002 02:01, James Hatridge wrote: > Hi all.. > > I'm using SuSE 8.0, mysql, and PHP4. Is it possible to make charts with a > database? If so, how about a hint on it? Easiest way is to use an existing class: jpgraph or search on www.phpclasses.org -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* paranoia, n.: A healthy understanding of the way the universe works. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Can't get data back into the database
contacts.php appears to have been chewed up ... fresh copy. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Charts...
Hi all.. I'm using SuSE 8.0, mysql, and PHP4. Is it possible to make charts with a database? If so, how about a hint on it? Thanks JIM -- Jim Hatridge Linux User #88484 -- BayerWulf Linux System # 129656 The Recycled Beowulf Project Looking for throw-away or obsolete computers and parts to recycle into a Linux super computer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Printing?
Hi all... I'm useing SuSE 8.0, mysql, and PHP with a HP L5 printer. Could someone give me a hint on how to print a form to my HP? What I want to do is print (on paper ) monthly customer statements. Thanks JIM -- Jim Hatridge Linux User #88484 -- BayerWulf Linux System # 129656 The Recycled Beowulf Project Looking for throw-away or obsolete computers and parts to recycle into a Linux super computer -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] keeping form field data when reloading a form
Thanks, that works great. -- Chip "Stuart McDonald" <[EMAIL PROTECTED]> wrote on 08/20/2002 05:55:40 PM: > Are you setting the variables in the form? > Something like this - note the value field in the username field: > >align="center" cellpadding="1" cellspacing="0" border="0" bgcolor=" #ff"> > > Username: > > > >Password: >size="15" style="width: 120px; font-size: 12px"> > > > >style="width: 50px; heigth: 18px; font-size: 12px"> > > > > This way, depending on how youare refreshing the login form, if the > $username variable passed your validation tests it should be set > automatically into the form. > Cheers > Stuart > > - Original Message - > From: <[EMAIL PROTECTED]> > To: "PHP_DB" <[EMAIL PROTECTED]> > Sent: Wednesday, August 21, 2002 12:58 AM > Subject: [PHP-DB] keeping form field data when reloading a form > > > I have my email checker working now, and all the other fields are checked > > also, but when I do enter > > some wrong data the form is reloaded with all blank fields. I'm sure there > > is a way to keep the existing > > data in the fields so the end-user will only have to change the incorrect > > fields, and not have to re-enter > > all the data. But how? > > > > -- > > Chip Wiegand > > Computer Services > > Simrad, Inc > > www.simradusa.com > > [EMAIL PROTECTED] > > > > "There is no reason anyone would want a computer in their home." > > --Ken Olson, president, chairman and founder of Digital Equipment > > Corporation, 1977 > > (They why do I have 9? Somebody help me!) > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Can't get data back into the database
Hi all, I'm writing this as a plugin for Squirrelmail. Its a simple address book but will have a lot of advantages once I've integrated it properly. I'm learning PHP so thought it would be a good first project. In terms of displaying records, it works a treat. Sadly, I can't get updating from it to work - the logic seems to break down when I edit an entry in the form and try to put that entry back into the database. I've been poking away at this problem for a day or so, I'm stuck and would appreciate a suggestion as to why the 'submit' button doesn't call PHP_SELF with the updated values. Thanks in advance. Apologies to anyone who is upset at the 9k attachment. Patrick DROP TABLE IF EXISTS people; CREATE TABLE people ( person_id tinyint(4) unsigned NOT NULL auto_increment, first_name varchar(30) NOT NULL, last_name varchar(30) NOT NULL, dob date DEFAULT '-00-00' NOT NULL, home_address varchar(255) NOT NULL, work_address varchar(255), home_phone varchar(30) NOT NULL, work_phone varchar(30) NOT NULL, mobile_phone varchar(30) NOT NULL, email1 varchar(30) NOT NULL, grouping varchar(30) NOT NULL, comments varchar(255) NOT NULL, organisation varchar(30) NOT NULL, title varchar(30) NOT NULL, PRIMARY KEY (person_id) ); ## last_name, first_name, title, organisation, work_phone, home_phone, mobile_phone, email1, home_address, work_address, grouping, notes--=_20020821161424_41493 Content-Type: application/octet-stream; name="config.php" Content-Disposition: attachment; filename="config.php" Content-Transfer-Encoding: base64 PD9waHAKCi8qIHVzZWZ1bCB2YXJpYWJsZXMgdGhhdCBnZXQgdXNlZCBhZ2FpbmEgbmQgYWdhaW4g Ki8KCiRob3N0bmFtZSA9ICJsb2NhbGhvc3QiOwokcGFzc3dvcmQgPSAidXNlciI7ICAgICAgICAg ICAgICAgICAgICAgICAgICAvLyBteXNxbCBwYXNzd29yZAokdXNlciA9ICJ1c2VyIjsgICAgICAg ICAgICAgICAgICAgICAgICAvLyBteXNxbCB1c2VyCiRkYm5hbWUgPSAiY29udGFjdHMiOyAgICAg ICAgICAgICAgICAgICAgIC8vIG15c3FsIGRhdGFiYXNlIG5hbWUKJHBpY3R1cmUgPSJicmhpbm84 YS5qcGVnIjsgICAgICAgICAgICAgICAgICAgIC8vIGRpc3BsYXllZCBpbiB1cHBlciBsZWZ0IGZy YW1lCiR0aXRsZV9tc2cgPSAiV2VsY29tZSB0byB0aGUgS2lyayBDb250YWN0cyBEYXRhYmFzZSAi OyAgICAgICAgICAgICAgICAvLyBUaXRsZSBNZXNzYWdlCgoKPz4K -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] time slots and PHP/MySQL
Don't want to get too philosophical, but don't PIM/Contact Management projects like TWIG have a feature like this? Now, this is just off the top of my head, but rather than create a timeslots table, wouldn't you have an event table, and a member_booked table? The minimum fields in event would be event_id(primary), start_time, end_time. Member_booked fields could be member_id, event_id, with maybe start_time and end_time, these two representing when the member is booked for an event. If a member is not found for a given event/time range in member_booked, presumably she's available. Note that "event" is generic, and could apply to any resource: meeting room equipment, meeting, etc. Downside to this, is that every member's scheduled event has to go into the member_event table, but it seems small so retrieval and update should be fast. Remember, this is a first kick at the can, and I'd bet there's a better way of doing it. Miles At 09:22 AM 8/21/2002 -0500, Matthew Crouch wrote: >this is a big question and i'm not trying to get you to do my modelling >for me, but if anyone has experience with this i'd appreciate being >pointed in the right direction: >How could one efficiently manage time slots in a dB? I mean for example >telling the dB that Mike can be somewhere at 6:15 or 6:30 but not 6:45, >and that Cynthia can be there at 6:15 or 7:00... >...and so on >my instinct is to create a "timeslots" table, but it looks like it would >contain 35,040 records (one for each 15-minute period in the year). egad! >The alternative is to create timeslots a month at a time or something, but >the table would have to be reformulated every month. > >any thoughts? feel free to get philosophical about it. > >-M > > >-- >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] Are running sessions using a MySQL handler faster?
Chances are the files-based one is probably a bit quicker. Especially on systems where /tmp is optimized or perhaps even set up as a ramdisk. -Rasmus On Wed, 21 Aug 2002, Jonathan Thomas wrote: > Good afternoon! > > Quick performance question - I'm currently preparing the release of a new > website running on a Linux box written in PHP and MySQL with sessions > throughout. > > I've read a bit about changing the PHP session handler to use a database vs. > the flat file method. > > Does anyone have experience doing this? Are there noticeable benefits of > making this change? I realize that my /tmp folder will become quite > cluttered with session files, but hey - it's tmp so who cares! :) My > concern comes in with overall performance of the server - if one method is > better than the other. > > Thanks for your feedback! > JT > > -- > 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] date comparison
On Wednesday 21 August 2002 21:28, Smita Manohar wrote: > hello, > in my script i want to compare input date with date stored in database and > want the result for date <= input date and sometime for date >= input date. How is the date stored? What type of field? > it didn't work for <= and >= operators. i also tried using "between" but it > didn't give desire result :-( How are you doing your comparison? As php code? As sql query? > is there any other comparison operator to be used for date??? <, <=, >, >= can all be used if your data is in the correct format. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Oh, yeah, life goes on, long after the thrill of livin' is gone. -- John Cougar, "Jack and Diane" */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Are running sessions using a MySQL handler faster?
Good afternoon! Quick performance question - I'm currently preparing the release of a new website running on a Linux box written in PHP and MySQL with sessions throughout. I've read a bit about changing the PHP session handler to use a database vs. the flat file method. Does anyone have experience doing this? Are there noticeable benefits of making this change? I realize that my /tmp folder will become quite cluttered with session files, but hey - it's tmp so who cares! :) My concern comes in with overall performance of the server - if one method is better than the other. Thanks for your feedback! JT -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: time slots and PHP/MySQL
Matthew, you may want to investigate MRBS (Meeting Room Booking System). it handles such things for resource allocation. i dont know where the project location is, but google is your friend "Matthew Crouch" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > this is a big question and i'm not trying to get you to do my modelling > for me, but if anyone has experience with this i'd appreciate being > pointed in the right direction: > How could one efficiently manage time slots in a dB? I mean for example > telling the dB that Mike can be somewhere at 6:15 or 6:30 but not 6:45, > and that Cynthia can be there at 6:15 or 7:00... > ...and so on > my instinct is to create a "timeslots" table, but it looks like it would > contain 35,040 records (one for each 15-minute period in the year). > egad! The alternative is to create timeslots a month at a time or > something, but the table would have to be reformulated every month. > > any thoughts? feel free to get philosophical about it. > > -M > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] time slots and PHP/MySQL
this is a big question and i'm not trying to get you to do my modelling for me, but if anyone has experience with this i'd appreciate being pointed in the right direction: How could one efficiently manage time slots in a dB? I mean for example telling the dB that Mike can be somewhere at 6:15 or 6:30 but not 6:45, and that Cynthia can be there at 6:15 or 7:00... ...and so on my instinct is to create a "timeslots" table, but it looks like it would contain 35,040 records (one for each 15-minute period in the year). egad! The alternative is to create timeslots a month at a time or something, but the table would have to be reformulated every month. any thoughts? feel free to get philosophical about it. -M -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] date comparison
hello, in my script i want to compare input date with date stored in database and want the result for date <= input date and sometime for date >= input date. it didn't work for <= and >= operators. i also tried using "between" but it didn't give desire result :-( is there any other comparison operator to be used for date??? thnx and regards, smita. _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php