Jump to content

rahulephp

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Everything posted by rahulephp

  1. From last few days I am struggling to achieve this. For some reason, we need to change the Foreground (display) color of animated gif images without losing their animation. I am sure there should be some ways to do thing but i couldn't able to find that. A website ajaxload[dot]info is doing approximately same thing but I am not sure how they got this using PHP. Can anyone suggest the similar kind of PHP script to change the color of gif images?? Thanks in advance
  2. Hello, I found Google Transliteration, a very good tool to reproduce the sounds of a sentence in a different language. Reference: http://code.google.com/apis/language/transliterate/v1/multilangtransliteration.html http://www.google.com/transliterate/ It supports approx. 22 languages. Can anybody please let us know how does make it to support German and Swedish too. I cant see these languages there. Highly appreciated if you could give an example or reference URL. Thanks in advance.
  3. How to speed up the Group By Clause for a large 3GB database. I am using Group by clause for a large database having 148 columns and 5 million rows with approx 3GB of size. We need to apply the Group by clause on approx 1,00,000 rows at a time without using LIMIT. We can’t use LIMIT as we need all of the entries from a category to be show in the filters section. We have a Dedicated Linux server with 4GB RAM and latest Configuration with 2 processors. I tried all different my.cnf configuration settings to optimize the mysql speed but nothing works. Here is Query that I am using to fetch the data: SELECT e.product_id, e.name, e.description, e.manufacturer, e.imageurl, e.warranty, e.colour, e.collection, e.saleprice, e.price, e.ages, e.size, e.size_h, e.size_w, e.size_d, e.size_unit, e.wifi_ready, e.bundled_deals_packages, e.service_provider, e.how_many_seats, e.characters, e.publishercategory, e.clean_modelno MAX(price) as max_price, MIN(price) as min_price, count(distinct(advertiserid)) as total FROM elec_products as e WHERE status = 1 AND (subcategory2 = 3115) GROUP BY clean_modelno, publishercategory ORDER BY total DESC I have index on following columns product_id PRIMARY KEY Group_by(clean_modelno, publishercategory) BTREE subcategory1 BTREE subcategory2 BTREE subcategory3 BTREE subcategory4 BTREE subcategory5 BTREE status BTREE Table Type is "MyISAM". All major My.cnf configurations: skip-locking key_buffer_size = 512M max_allowed_packet = 128M table_open_cache = 512 sort_buffer_size = 128M read_buffer_size = 128M read_rnd_buffer_size = 128M myisam_sort_buffer_size = 128M thread_cache_size = 8 query_cache_size = 128M max_heap_table_size=256M tmp_table_size=256M join_buffer_size = 2M I can see lots of other similar Price Comparison website which has excellent pageload speed. Please help me out from this and let me know if I am missing anything.
  4. Here is server specs with some modifications. http://order.1and1.com/xml/order/VirtualServerXL
  5. Hi all, First of all I am new with server using. Below my virtual private server details: Processor : 2.8 GHz Dual Core Processor Cores: 2 RAM Memory : 4GB Apache Version: Apache/2.2.3 (CentOS) PHP Version 5.1.6 MySQL Version: 5.0.77 HDD: 100GB Bandwidth: Unlimited Due to 3GB of database size, server may not respond some times and working very slow even if good server configuration. Website is running good on our local computers. I think, I need to change the mysql configuration settings for online server. Please help me out to set the best configuration of my.cnf for above server specially following settings: (Table type is MyISAM) connect_timeout = 20 key_buffer_size = 64M max_allowed_packet = 2G table_cache = 100M wait_timeout= 360 interactive_timeout = 360 key_buffer = 16M sort_buffer_size = 512K net_buffer_length = 8K read_buffer_size = 256K read_rnd_buffer_size = 512K myisam_sort_buffer_size = 8M Thanks in advance
  6. I have a table with 4 columns Table name = products Column name = product_id, product_programname, product_title, model_number When I use GROUP BY with model_number, it alway returns me the info of product (ebay) which comes first in the queue. But i want to get the title from ' argos ' if not null else ' buy ' if not null etc. The below query doesn't works for me. SELECT *, ( case(true) WHEN product_programname = 'argos' AND product_programname IS NOT NULL THEN product_title WHEN product_programname = 'buy' AND product_programname IS NOT NULL THEN product_title WHEN product_programname = 'amazon' AND product_programname IS NOT NULL THEN product_title WHEN product_programname = 'ebay' AND product_programname IS NOT NULL THEN product_title WHEN product_programname = 'next' AND product_programname IS NOT NULL THEN product_title END ) as final_title FROM products GROUP BY model_number Please assist how come it'll be possible.
  7. How to fetch the "name" FROM programname = "Buy" and description which has maximum words using GROUP BY?? I have 6 columns with thousands of product entries: Table name : eproducts Columns : product_id, programname, name, description, clean_modelno Ex. Products Entries: product_id : 5001 programname : argos name : Toshiba 32RV753B description : By Toshiba (100 words) model_number : 32RV753B price : 549.99 product_id : 5002 programname : Buy name : Toshiba 32 Inch Full HD 1080p Freeview HD LCD TV description : Television picture quality: Freeview HD digital (Approx 110 words) model_number : 32RV753B price : 499 product_id : 5003 programname : Amazon name : Toshiba 32 Inch Widescreen Full HD 1080p LCD TV desciption : 66cm Visible LCD HD Ready Integrated Digital (Approx 90 words) model_number : 32RV753B price : 650 product_id : 5004 programname : Ebey name : 2RV753B 32Inch HD Ready 1080p LC HD Read description : Toshiba 32RV753 / 32RV753B 32" REGZA RV Serie (Approx 97 words) model_number : 32RV753B price : 550 When I Group by the products using there model numbers, it gave me the first row as output as all these four products has same model number: SELECT *, MAX(price) as max_price, MIN(price) as min_price, count(distinct programname) as total_retailers FROM eproducts as e WHERE GROUP BY model_number BUT, I want to get the "name" FROM programname : Buy and description which has maximum words from all four descriptions. Please suggest me a good and efficient solution.
  8. I have three columns - id, programname, status I wanted to use UPDATE with IF condition something like this: UPDATE elec_products IF(programname ='Argos') ( SET status = 1 ) ELSEIF(programname ='sify') ( SET status = 2 ) ELSE ( SET status = 3 ) ENDIF WHERE programname IS NOT NULL I am not sure if it'll be possible. Please suggest the best possible ways to do this. Thank you
  9. On my search result page, I wanted to search for "Nintendo DS Lite - Pink" I used following code: Ex: $search_text = "Nintendo DS Lite Pink"; $kt=split(" ",$search_text);//Breaking the string to array of words // Now let us generate the sql while(list($key,$val)=each($kt)) { if($val<>" " and strlen($val) > 0) { $q .= " name like '%$val%' or "; } }// end of while //Remove the last 'OR' $q=substr($q,0,(strlen($q)-3)); Than the $q would be: SELECT * FROM `products` WHERE name like '%Nintendo%' or name like '%DS%' or name like '%Lite%' or name like '%Pink%' And i am getting Mysql Output given below: 1) Activity Meter - DS. 2) Nintendo DS Red. 3) Nintendo DS Lite Pink. 4) Nintendo DS Lite Turquoise. But the third result is most accurate/relevant then first two result. Please help me out to get the most accurate row first then the relevant rows as per their relevancy with search term "$search_text" Many Thanks in Advance.
  10. Yes, actually i wanted too use the same kind of switch statement somewhere in my website but cant be able to post the actual code as it has 100+ lines. Thats why i wrote here a simple and same kind of code.
  11. In below switch statement, it should have to print only "T","E","S" characters as string "testing" contains these words. But it is printing all characters including "X" and "Z". I can’t use "break;" because it will break operation after first case. (After matching "T" with word "testing") but I want to continue the operation even after every case to find the next character. Please advice if anything is missing. switch(true) { case stristr('testing','t'): echo "T"."<br>"; case stristr('testing','x'): echo "X"."<br>"; case stristr('testing','e'): echo "E"."<br>"; case stristr('testing','z'): echo "Z"."<br>"; case stristr('testing','s'): echo "S"."<br>"; }
  12. I am a php programmer but I am not so good with XML files. For a price comparison website, I need to parse the Amazons XML feed to store product data into the database. Can anyone please help me to find out such a simple script to parse Amazon XML product feed??? (Actually, I need each product data in array to be stored into the database) Thank you in advance.
  13. Thank you buddy, I got the solutions. Here it is: UPDATE related_category INNER JOIN product_category ON related_category.rel_cat_id = product_category.cat_id SET related_category.rel_cat_name = product_category.cat_name
  14. Mysql - How to use UPDATE with SELECT??? I have two tables: 1) products_category -cat_id -cat_name 2) related_category -rel_cat_id (exaclty same as products_category.cat_id==related_category.rel_cat_id) -rel_cat_name products_category table related_category table I want to get cat_name from products_category and want to store in rel_cat_name in related_category tabel. and the query should be only one. Not sure how will it works. I thought it would be something like: UPDATE related_category SET related_category.rel_cat_name = ( SELECT product_category.cat_name FROM product_category INNER JOIN related_category ON related_category.rel_cat_id = product_category.cat_id ) But it doesn't works, Please assist. Thanks in advance
  15. Excellent mjdamato and gwolgamott , It works for me. Thanks in bunch
  16. Can anyone please let me know how to separate Model Numbers from a string ForEx Titles: 1) Sony DCSW380B 14MP Camera 2) Casio 10MP Camera EX-Z3/3 3) Panasonic Lumix Camera DMC-G1 12MP Output would be: For 1) "DCSW380B 14MP" OR ""DCSW380B" For 2) "10MP EX-Z3/3" OR "EX-Z3/3" For 3) "DMC-G1 12MP" OR "DMC-G1" Criteria: 1) All letters of model number are CAPITAL 2) It may include alphabets, numbers or special symbol like "/", "-" 3) Model numbers can be anywhere in the title (not a specific position like 2nd in array on explode) Not sure if i need to use preg_match function. Please assist. Thanks in advance
  17. Hi, In normal php, We use ?id=123 to send variable through URL. So, the URL would be www.example.com/page.php?id=123 and then we use $_REQUEST['id'] to receive the variable on another page. But my question is, if I use "/" instead of "?" (Ex: www.example.com/page.php/id/123), then how to receive the "id" on page.php. $_REQUEST['id'] doesn't works in this case. Thank you in advance
  18. I am looking for the PHP Ajex mouse move popup box. It should show a small cool looking popup window when i move mouse on "Seller" link. I saw this thing here: Move the mouse on "Sellers" (next to the Star rating at the bottom of search product) http://cameras.pricegrabber.com/digital/camera/p/48/form_keyword=camera/rd=1 Please let me know from where to get such Ajax popup window Thank you
  19. Hi, I need to send product id with URL something like this: http://www.example.com/product.php?id=292&name=sony-digital-camera But this URL is not good enough for seo. Can anyone please let me know how to pass the ids and name (without "product.php") so that I will extract the id later http://www.example.com/sony-digital-camera-292.php All the operation takes place at "product.php" so I can't ignore it. But I don't want "product.php" page to be shown in URL. After rendering "product.php" page with respective product id, I'll get all of the parameters like name, price, description etc. Then now the URL of page would have to be (like this) http://www.example.com/sony-digital-camera-292.php (without "product.php") Thank you in anticipation
  20. Got the solution: SELECT * FROM `products` WHERE product_id IN ('5','8','9','12'); [/cods]
  21. Please help me to find out the solution. I want to fetch data from "product" table where "Product_id"(s) are 5,8,9,12... I am using the query: SELECT * FROM products WHERE product_id=5 OR product_id=7 OR product_id=8 OR product_id=9 OR product_id=12 But i dont want to use "product_id=" again and again many time. Just wondering if there any sql syntax like "SELECT * FROM products WHERE product_id=(5,8,9,12)" ? Above statement is only a assumption but wanted to know if there is anything possible like this. Thanks in anticipation
  22. Hi there, Could you please help me to find-out the solution? I need to use "LIKE" command of mysql. Below are title from a Product table. If i search for "Alarm" then it should show me result only for title which has word alarm. (0th and 2nd only) table_name = product Column_name = title 0 ->Casio G-Shock Velocity Indicator Alarm watch 1 ->Seiko Velatura Tachymeter Chronograph watch 2 ->Citizen promaster Alarm perpetual watch Thank you in anticipation
×
×
  • 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.