Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: pushyr
  • Content: Threads
  • Order by date
  1. pushyr

    preg_match_all not matching everything

    I'm trying to do a preg_match_all, but it's not matching everything. about 30% gets missed, here's a sample of the full text that i'm using preg_match_all on... I'm trying to match everything that's in-between these lines here's my code...
  2. pushyr

    convert freindly date and time to mysql format

    is there a simple way to convert a friendly date and time to a mysql format my date and time looks like this... Tue, 31 Jul 2012 13:17:23 GMT and i'd like to both split and convert into this... 1. 2012-07-31 2. 13:17:23
  3. pushyr

    trying to regex first line of text

    this is perhaps one of the simplest things to do, but after googling i just can't find anything that works. Here's my own concoction, which doesn't work. ...so, how would i regex the first line from a block of text preg_match("#^(.*?)\r\n#is", $content00);
  4. pushyr

    using php to load mysqldumps

    i have a single mysqldump file with quite a few large tables. the file totals about 4.5gb i would like to load the file (all these tables and their contents) into a mysql database using php after searching i couldn't really find anything that put me on the right path. how would go about...
  5. pushyr

    geting the second to last result from a loop

    Hi, I've got a while loop like this.... while ($queryTable01 = mysql_fetch_array($queryTable00)) { } if the result is something like this... 1 2 3 4 5 6 how would i get the second to last result being... '5' ?
  6. pushyr

    using mysl queries to produce ratios

    is there a way to calculate ratios within a mysql query? for example if i have 2 columns in the same table column A = 10 column B = 2 then the ratio is 5:1 I normally do this using php but i'd now prefer to simplify things by doing as much as i can in the query
  7. pushyr

    generating a nonce code

    i'm trying to generate a nonce code from php. surpisingly there's very little that i found when searching google i've found this site that generates the nonce for you using js... http://www.teria.com/~koseki/tools/wssegen/ the way it works i insert my username and password then select auto for...
  8. pushyr

    Fatal error: Allowed memory size of 33554432 bytes

    I'm getting this error message... line 428 has this line of code... $lines = file($Cdir.$file_names[$i]); what the code does... 1. reads a csv file 2. if it detects the word 'copyright' it then removes the first 15 lines ... it does this by copying the whole file content then writing the...
  9. pushyr

    a little regex help on dates

    I have a bit of regex code.... preg_match('#(?P<month>\w+) (?P<day>\d+) (?P<year>\d+)#', $dataAB[0], $haveDate0); for dates that are formatted as for example, Aug 14, 2010, it will output... $haveDate0[year] $haveDate0[month] $haveDate0[day] but if the date is formatted as Aug 4, 2010...
  10. pushyr

    matching IP with ISP

    Is it possible to use php to match IP addresses with their ISPs?
  11. pushyr

    help with limit and sum

    i can select records 1- 10 using... GROUP BY x ORDER BY x DESC LIMIT 10 and i can select a specifc range of records... GROUP BY x ORDER BY x DESC LIMIT 10,15 but what i can't figure out are two things.... 1) selecting records from 10 to the last row i can do it by saying LIMIT 10,10000000 but...
  12. pushyr

    encrypting your code

    i've just finished writing an app and i would like to protect it by using encryption. i've googled 'php encrypt code', but thought it'd be better if i asked the question here as you guys would have a good amount of experience with encrypting you work. what would be my best approach? is there...
  13. pushyr

    writing one query, to replace several simple queries

    I have a table that consists of the following… dateStart dateEnd entries segment vol1 vol2 vol3 vol4 28/12/09 3/1/10 entrya segment1 2 2 2 3 28/12/09 3/1/10 entryc segment1 1 1 1 0 28/12/09 3/1/10 entryb segment0 7 1 1 0 28/12/09 3/1/10 entryd segment0 1 1 5 5 18/1/10 24/1/10 entrye...
  14. pushyr

    regex to format a date for mysql... separated with hyphens

    i'm trying to format a date for mysql the date is is currently 20100201 but i'd like to format it as 2010-02-01, separated with hyphens what would be the ideal regex code to do this?
  15. pushyr

    regex - how to remove the last character in a line

    if i have a string like this... a bit of text here, and a bit of text there, and some more, just here what regex would i use to remove the last comma? there could be any amount of commas (i wouldn't know how many), but i would like to remove (replace) the last one.
  16. pushyr

    can't get my curl login script to work?

    i've been following tutorials by the letter, but can't get my curl login script to work do you see something that i might be doing incorrect? $loginPage = 'http://www.test_page_login.com'; $useragent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204...
  17. pushyr

    copying files from one directory to another

    i'm trying to copy a file from one directory to another here's my script so far... $path_source = ''.$_SERVER[DOCUMENT_ROOT].'/folder/original/'; $path_destination = ''.$_SERVER[DOCUMENT_ROOT].'/folder/new/'; $file = ''.$path_source.'image.jpg'; copy($file, $path_destination); but i get...
  18. pushyr

    a php content management system

    just a little advise needed... from now on, when i develop sites for others i will no longer plug their sites into my own cms. to reduce headache i want to provide clients with total ownership by using an open source cms installed on their own server. can anyone give advice on what is the...
  19. pushyr

    regexing phone numbers

    ok, here's another little problem that i have.... there are three types of numbers i'm trying to match... 07912123456 07912 123456 07912-123456 here's my regex... '#([0-9]{10,14})|([0-9]{5})\s([0-9]{4,7})#' ([0-9]{10,14}) works fine for this number format 07912123456 but for the other...
  20. pushyr

    a little regex trouble

    hi, im trying to match a line of text from the code below i want to match this line... var addy_text8756 = 'm&#111;n&#105;q&#117;&#101;' + '&#64;' + 'cr&#111;yd&#111;n&#101;b&#111;ny&#101;sc&#111;rt' + '&#46;' + 'c&#111;' + '&#46;' + '&#117;k'; i've tried using this preg_match '#var...

Part and Inventory Search

Back
Top