Jump to content

poe

Members
  • Posts

    143
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

poe's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. 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
  2. i think this seems to work.. $html = preg_replace('#Hm0_([0-9]+).js#', 'Hm0_\1.xx', $html); thanks chris
  3. 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
  4. 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
  5. 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
  6. 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
  7. 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 ?
  8. poe

    password protect

    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
  9. 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) !
  10. 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
  11. 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
  12. 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 .....
  13. Keith, this is working pretty good ! thanks chris
  14. 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 ??
  15. 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
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.