Re: [PHP-DB] regex question
At 11:04 3/7/2005, Chip Wiegand wrote: >I am writing some regex on a php form to validate input and have come up >with this, for example - > >if (empty($first) || !eregi("^[A-Za-z]+[- ]?[A-Za-z]+$", $first)) > >for checking a persons name. This allows a single name, or a hyphenated >double name, or a non-hyphenated double name, and it works. My question is >this - why is the third set followed by a '+' optional? I thought the + >meant the preceding group is present 1 or more times. The ? means the >preceding group is present 0 or more times. Why is it that when I put a ? >in the place of the + after the last ] > >if (empty($first) || !eregi("^[A-Za-z]+[- ]?[A-Za-z]?$", $first)) > >the regex is broken? > >Regards, >Chip If you want to add the capability for those weird, foreign names [ ;^) ], take a look at the RegEx on this page: http://www.RegExLib.com/UserPatterns.aspx?authorId=45511 Start Here to Find It Fast! -> http://www.US-Webmasters.com/best-start-page/ $8.77 Domain Names -> http://domains.us-webmasters.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Drop-down box in php
At 10:53 4/20/2004, andy amol, wrote: >hi, > >Also if you can help me with a date validation program I will be grateful. You could use a Regular Expression: http://tinyurl.com/yr6up http://www.Google.com/search?q=regular+expressions+site%3Aphp.net Start Here to Find It Fast! -> http://www.US-Webmasters.com/best-start-page/ $8.77 Domain Names -> http://domains.us-webmasters.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Display of fetched MySQL data?
Thanks! mysql_fetch_assoc did the trick. At 07:08 3/25/2004, Ryszard Hapka wrote: >not only foreach ;) > >$r = mysql_query("select * from table"); >while($t = mysql_fetch_assoc($r)) { // or while ($t = >mysql_fetch_array($r)) <-- you will see difrends >foreach($t as $key => $value) { >echo "[".$key."] ".$value .""; >} >echo ""; Start Here to Find It Fast! -> http://www.US-Webmasters.com/best-start-page/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Display of fetched MySQL data?
Hi Folks, I am trying to display a list of retrieved records, but can't seem to figure out how to do this properly. Here is what I am aiming for: \n"; // Loop through the fields for ($FieldIdx = 1; $FieldIdx <= NumFields; $FieldIdx++) { // Display the fields and associated data /* What code goes here? */ } } // End for ($RowIdx = 1; $RowIdx <= NumRows; $RowIdx++) ?> How do I properly display the fieldname and its associated data? I know that you can do something like this using foreach, but I wanted a generic routine where you don't necessarily know the fieldnames. Any hints? (Thanks if you do!) Start Here to Find It Fast! -> http://www.US-Webmasters.com/best-start-page/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MySQL - separating web and database servers
At 09:20 3/18/2004, Adam Voigt wrote: >I don't understand, your ready to hack the MySQL extension, rather then >just use one of the free text editors, that let you mass replace all >your pages at once (which takes roughly 10 seconds)? Adam is right. Make backups of all the files, then do the edits. If you have Windows, Replacem is great: http://www.Orbit.org/replace/ Does a similar program exist for GUI Linux/FreeBSD? Start Here to Find It Fast! -> http://www.US-Webmasters.com/best-start-page/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] TIME CALCULATION IN PHP
At 23:44 1/27/2004, Delz, wrote: >Hi All, > >How do i calculate time in PHP lets say I have this example > >Input Time Started : 9:00 >Input Time Ended : 13:00 > >Answer >Total Time in Hours : 4 >Total Time in Minutes : 240 What happens when they start at 23:59 and end at 01:30? This may never happen in your situation, but it's always wise to plan for this possibility. UnixTime has dates, time in hours mins & secs so you can add and subtract easily. There are a number of functions in PHP that allow you to manipulate these. For more info: http://us4.php.net/datetime http://www.Google.com/search?q=add+subtract+dates+times+php+examples Start Here to Find It Fast! -> http://www.US-Webmasters.com/best-start-page/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Real Killer App!
At 01:58 3/14/2003, Nicholas Fitzgerald wrote: >As you guys know I've been going around in circles with this spider app >problem for a couple days. > >How would you do it? http://www.hotscripts.com/PHP/Scripts_and_Programs/Search_Engines/more3.html Start Here to Find It Fast!© -> http://www.US-Webmasters.com/best-start-page/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php