poe
Members-
Posts
143 -
Joined
-
Last visited
Never
Everything posted by poe
-
i am trying to do a rewrite on 2 different types of urls.. the first configuration can be 1 of 3 ways... http://localhost/site/index.php?type=top&pg=2 http://localhost/site/index.php?type=new&pg=3 http://localhost/site/index.php?type=fav&pg=1 etc... i want to rewrite so it shows as http://localhost/site/top/2/ http://localhost/site/new/3/ http://localhost/site/fav/ notice how the third sample (pg 1) doesnt need to show fav/1/ in the url, but instead show as /fav/ so far i have : RewriteEngine On RewriteRule ^top/([a-zA-Z0-9]+)[/]?(.*)$ index.php?type=top&pg=$1 RewriteRule ^new/([a-zA-Z0-9]+)[/]?(.*)$ index.php?type=new&pg=$1 RewriteRule ^fav/([a-zA-Z0-9]+)[/]?(.*)$ index.php?type=fav&pg=$1 ... but i am missing how i can leave off the last part of the url if it is page 1 the second configuration is similar to the first except it is done by an infinite number of categories, which i would like to avoid listing each rule out seperatley per category. the url will look like this... http://localhost/site/index.php?cat=apparel&pg=2 http://localhost/site/index.php?cat=toys&pg=1 http://localhost/site/index.php?cat=footwear&pg=6 etc.... (can have unlimited number of categories) and again my goal is to have the url look like : http://localhost/site/apparel/2/ http://localhost/site/toys/ http://localhost/site/footwear/6/ and just like the first configuration, if on page 1, i wish to leave the pg out of the url. so far i am trying to work with something like this : RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)[/]?(.*)$ index.php?cat=$1&pg=$2 it fails when i try a url with no page defined (page 1) thanks chris
-
i think this seems to work.. $html = preg_replace('#Hm0_([0-9]+).js#', 'Hm0_\1.xx', $html); thanks chris
-
i need to replace all text references that have vbHmo characters from : this -> that: vbHm0_156.js -> vbHm0_156.xx vbHm0_1409.js -> vbHm0_1409.xx vbHm0_1267.js -> vbHm0_1267.xx the # after the _ is a random number and can be either 1 to 5 digits inlength.. so basically all i am fdoing is changing the .js to .xx
-
i am reading an html file... i do not have the string.. i am trying to find it... so the string i am looking for is "basePath":"\/" so i need to find the string in the page and change to "basePath":"www.mypage.com\/" ie. here is part of the full string i am searching
-
i have this string "basePath":"\/" how do i do a preg_replace to this "basePath":"www.mypage.com\/" i tried this, but doesnt work $repWhat = "/\"basePath\":\"\/\"/i"; $toWhat = "\"basePath\":\"www.mypage.com\/\""; $html = preg_replace($repWhat, $toWhat, $html); thanks
-
i have 2 arrays... first array of lastnames, second array of firstnames lastAry = array('smith', 'jones', 'reed', 'chan') firstAry = array('mary', 'chris', 'kim', joe', 'sara', 'tim', 'amy', 'fred') how do i loop through each lastnames and turn into a string with firstname so it looks like : smith | mary | chris jones | kim | joe reed | sara | tim chan | amy | fred
-
204 no content error : If you click a link which has no target URL, this response is elicited by the server. It's silent and doesn't warn the user about anything. what exactly does this mean... i search everywhere for 204 error, and every page i find gives the same definition but do not give example of what it means ! if i wanted to intentionally create this error how would i do it ?
-
if i have 5 folders in my directory /vacation /house /friends /pets /sports how do i password protect each folder, with each folder having a different userID & password ? thanks chris
-
i have this in access: SELECT INVENTORY.WHSE AS I_WHSE, INVENTORY.CODE AS I_PART_NO, INVENTORY.INV_DESCRIPTION AS I_DESCRIPTION, ck_brand.MASK AS b, ck_deal.MASK AS d FROM INVENTORY inner JOIN ck_brand ON (INVENTORY.WHSE=ck_brand.I_WHSE) AND (INVENTORY.CODE=ck_brand.I_PART_NO) inner JOIN ck_deal ON (INVENTORY.WHSE=ck_deal.I_WHSE) AND (INVENTORY.CODE=ck_deal.I_PART_NO); i get this error : syntax error (missing operator) in query expression if i go : SELECT INVENTORY.WHSE AS I_WHSE, INVENTORY.CODE AS I_PART_NO, INVENTORY.INV_DESCRIPTION AS I_DESCRIPTION, ck_brand.MASK AS b FROM INVENTORY inner JOIN ck_brand ON (INVENTORY.WHSE=ck_brand.I_WHSE) AND (INVENTORY.CODE=ck_brand.I_PART_NO); everything is ok. problem is i need it to pull from 2 inner join tables (ck_brand AND ck_deal) !
-
i have this query which works ok: SELECT PURCHASE_ORDER_DTAIL.WHSE, PURCHASE_ORDER_DTAIL.CODE, PURCHASE_ORDER_DTAIL.POD_DESCRIPTION, PURCHASE_ORDER_DTAIL.BVORDQTY, PURCHASE_ORDER_DTAIL.BVTODATEQTY, PURCHASE_ORDER_DTAIL.BVUNITPRICE AS 'POCOST', PURCHASE_ORDER_DTAIL.BVORDQTY-PURCHASE_ORDER_DTAIL.BVTODATEQTY AS 'ONPO', CASE PURCHASE_ORDER_DTAIL.WHSE WHEN 'QT' THEN 'U_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'U1' THEN 'U_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'VM' THEN 'U_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'GR' THEN 'U_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'AT' THEN 'U_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'AC' THEN 'U_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'C1' THEN 'C_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'RE' THEN 'C_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'RQ' THEN 'C_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'QM' THEN 'C_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'FG' THEN 'C_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) WHEN 'X1' THEN 'X_'+RTRIM(PURCHASE_ORDER_DTAIL.CODE) END AS 'LOOKUP' FROM PURCHASE_ORDER_DTAIL WHERE (PURCHASE_ORDER_DTAIL.BVORDQTY>0) but when i add : ONPO*POCOST AS 'EXT' it fails
-
add-on... if i wanted to pull the description from a completly different table. how / where would i put in a LEFT JOIN ? i tried... but it isnt working
-
hello, I had previously posted about adding qty from 3 separate tales in 1 query. my new question is : can i run 3 separate queries within the same single query on just 1 table ? i have a table with : the result i want is lid 1, ttl hits for month 12 = 35, ttl hits for 2009 = 35, ttl hits wk > 51 = 25 lid 2 .....
-
Keith, this is working pretty good ! thanks chris
-
Hi Keith, Will any sku / whse on sell and po always be on inventory? NO, a sku/whse could be on just 1, 2 or all 3, but not always on inventory, YES the description for an exact sku/whse is the same everywhere. Thanks Chris. I tried playing around with UNION, but cant seem to get it to group & sum the qty. - maybe UNION isnt the way to go ??
-
i have 3 tables: 1. inventory (sku, whse, desc, sohqty) 2. sell (sku, whse, desc, sellqty) 3. po (sku, whse, desc, poqty) inventory : each record is unique po & sell : may have records with duplicating lines the search is by sku & whse how do i get DISTINCT sku_whse from all 3 tables in one sql statement as you can see in the : 1. inventory table - by concatenating sku & whse, all records are unique 2. sell table - sku 1_whse c1 is listed multiple times (ie to 3 different customers) and sku 12_whse c1 is also sold to multiple customers AND it is not listed on either inventory table or po table 3. po table - sku 13_whse c1 is also listed multiple records and is also NOT included in the inventory table or sell table INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 1, 'C1', 'DESC 1', 10 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 2, 'C1', 'DESC 2', 15 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 3, 'C1', 'DESC 3', 20 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 4, 'C1', 'DESC 4', 25 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 5, 'C1', 'DESC 5', 30 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 6, 'C1', 'DESC 6', 35 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 7, 'C1', 'DESC 7', 40 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 8, 'C1', 'DESC 8', 45 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 9, 'C1', 'DESC 9', 50 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 10, 'C1', 'DESC 10', 45 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 4, 'X1', 'DESC 4', 60 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 5, 'X1', 'DESC 5', 75 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 6, 'X1', 'DESC 6', 80 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 7, 'X1', 'DESC 7', 85 ); INSERT INTO `INVENTORY` ( `SKU`, `WHSE`, `DESC`, `SOHQTY` ) values ( 8, 'X1', 'DESC 8', 90 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 1, 'C1', 'DESC 1', 8 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 1, 'C1', 'DESC 1', 9 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 1, 'C1', 'DESC 1', 7 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 2, 'C1', 'DESC 2', 4 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 2, 'C1', 'DESC 2', 5 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 2, 'C1', 'DESC 2', 1 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 5, 'C1', 'DESC 5', 2 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 5, 'C1', 'DESC 5', 5 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 5, 'C1', 'DESC 5', 4 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 6, 'C1', 'DESC 6', 6 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 6, 'C1', 'DESC 6', 8 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 9, 'C1', 'DESC 9', 9 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 12, 'C1', 'DESC 12', 5 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 12, 'C1', 'DESC 12', 7 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 15, 'C1', 'DESC 15', 8 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 15, 'C1', 'DESC 15', 2 ); INSERT INTO `SELL` ( `SKU`, `WHSE`, `DESC`, `SELLQTY` ) values ( 15, 'C1', 'DESC 15', 3 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 1, 'C1', 'DESC 1', 25 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 4, 'C1', 'DESC 4', 15 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 4, 'C1', 'DESC 4', 10 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 6, 'C1', 'DESC 6', 17 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 6, 'C1', 'DESC 6', 8 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 6, 'C1', 'DESC 6', 23 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 11, 'C1', 'DESC 11', 30 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 12, 'C1', 'DESC 12', 25 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 13, 'C1', 'DESC 13', 28 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 13, 'C1', 'DESC 13', 15 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 14, 'C1', 'DESC 14', 17 ); INSERT INTO `PO` ( `SKU`, `WHSE`, `DESC`, `POQTY` ) values ( 15, 'C1', 'DESC 15', 26 ); my ultimate goal is to list all unique sku_whse with desc, and 3 qty columns sum(sohqty) sum(sellqty) sum(poqty) so the result will look like : SKU_WHSE DESC SOHQTY SELLQTY POQTY 1_C1DESC110 2425 2_C1DESC215100 4_C1DESC425 025 5_C1DESC530 110 5_X1DESC575 00 6_C1DESC635 1448 6_X1DESC680 00 7_C1DESC740 00 7_X1DESC78500 8_C1DESC84500 8_X1DESC89000 9_C1DESC95090 10_C1DESC104500 11_C1DESC110030 12_C1DESC1201225 13_C1DESC130043 14_C1DESC140017 15_C1DESC1501326
-
hi, i found this snippet on php.net so if i go : week_of_year(1, 3, 2010) (sunday) the week shows as 1, because the script is set to begin new week on sunday, however i am confused by his instruction " (x + 6) % 7 " to have the week start on a monday what part of the script do i apply this equation ??? thanks poe
-
i have a table that look like this : LID HIT MTH TYPE 111 2 200712 R 222 2 200712 R 111 1 200712 R 222 1 200812 R 333 5 200812 R 444 1 200812 R 555 3 200812 R 111 2 200812 R 111 6 200904 F 444 1 200904 R 333 1 200904 F 111 5 200907 R 222 5 200907 R i want to count the number of links that: MTH > 200712 MTH < 200907 TYPE = 'R' SUM(HIT) > 3 so far i have SELECT * , sum(`HIT`) AS `TTL` FROM `STATS` WHERE `MTH` > 200712 AND `MTH` <= 200907 AND `TYPE` = 'R' AND `TTL` >3 GROUP BY `LID` now i am stuck !
-
i currently receive a monthly email report from statcounter.com showing visitor traffic to my site : unique vistors, first time, page loads etc. every month when i receive this email, i then manually take the data and post it to my webpage, storing it in a mysql database so i can then display the statistics on my own webpage. it can be quite tedious doing this every month. (its not a lot to enter) but it is a real pain in the arse ! is there anyway to have the email sent to a php program (if possible ??) and have the php read through the body of the email, pulling out the info i need and automatically posting to the mysql db. or is it possible to have a script read the email, and save the email body as a text or log file, which i can then read and post to mysql with php thanks chris
-
from what i can find: the dynamic select menu is for populating a second select menu based on what is selected in the first select field. what i am actually looking for is to click a button or link somewhere on a page and have a select menu automatically drop down showing your options.
-
i know when i have a select form it is 'closed' and when i click the small arrow it opens to show the options. how do i make a small image that when i click the image, the select form will 'open' to show the options. thanks chris
-
i am trying to make a counter that shows the tally and where people come from and since i do get alot of people coming from mail i end up with a lot of things like: as you can see, b3.mail.yahoo.com and b5.mail.yahoo.com are both from mail.yahoo.com so the desired result i want is here is what i have so far, but i dont think it is right basically i pass the 'host' to the function it checks my array list of emails if it finds one, it uses the 'cleaner' version, or else it stays the same. at the moment i think my unction loos through each array, but it returns the result on the first loop. i guess i need it to loop through, and if it finds something in the atrray, then return otherwise, keep looping, until it runs out, and at that point: return function clean_email($chkhost) { $arrEmail = array('mail.live.com', 'mail.yahoo.com'); foreach($arrEmail as $k => $cleanEmail) { $haystack = strtolower($chkhost); $needle = $cleanEmail; $pos = strpos($haystack, $needle); $result = ($pos === false) ? $chkhost : $cleanEmail; return $result; } }
-
how do i validate valid currency from a form the form can either be like: 24.75 (no dollar sign, dollars & cents) $24.75 (with a dollar sign) $24 (with dollar sign, no cents) 24 (no dollar sign, no cents) thanks chris
-
i have my dates stored in the db like in a field called fulldate: 1210118400 1210032000 1209945600 etc... how do i do a query to count number of records that are in apr, may, june etc... i have: $ttl_apr = $db->numRowsQ(" SELECT * FROM clicks WHERE date('M', fulldate) = 'April' "); $ttl_may = $db->numRowsQ(" SELECT * FROM clicks WHERE date('M', fulldate) = 'May' "); thanks
-
i have thousands of errors in my log file that look like: the only difference is the date / time. any way of know what is causing these errors?