Jump to content

Nuv

Members
  • Posts

    212
  • Joined

  • Last visited

About Nuv

  • Birthday 10/31/1987

Profile Information

  • Gender
    Male

Nuv's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. I have a database something like mentioned below. Please note that this is not the complete table structure. Only the relevant is shown. CREATE TABLE IF NOT EXISTS `student` ( `id` int(13) NOT NULL AUTO_INCREMENT, `title` varchar(3) NOT NULL, `firstname` varchar(30) NOT NULL, `middlename` varchar(30) NOT NULL, `lastname` varchar(30) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; I'm collecting the name in 3 parts, Firstname , Middlename and Lastname . Now while searching for a name i'm trying to CONCAT all the 3 parts and then search. $sql_name = mysqli_query($con, "SELECT * FROM `student` WHERE CONCAT( firstname,' ', middlename,' ', lastname ) Like '".$search."%' LIMIT ".$start.", ".$limit."") or die("Error: ".mysqli_error($con));; I'm only wondering if there is a better and faster way to achieve this ? While searching over the web i saw some people using the 'difference' between name and search string and displaying it in descending order, however they weren't using MySql .
  2. When i am trying to do this simple math, php gives me rounded off result. $i = 44061410; $get_id = (2*$i + 76561197960265730) - 2; Expected Result - 76561198048388548 Result i am getting from php - 7.65611980484E+16 How can i see expected result ? Thankyou
  3. Yes you are correct. I am really sorry, i did try that. It didnt work at that time. Now it is. Thanks a lot.
  4. Btw im using reset.css too as mentioned here.
  5. Did so. Doesnt help Thankyou for replying though
  6. I want that my text container's width should be static (100px). However, when i put width:100px; in my #content the main container (with orange color) changes its width and not the text. The text should come to the next line after exceeding 100 px My HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>CMS - BLOG </title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="main.css" type="text/css"> </head> <body> <div class = "container"> <div class="content-container"> <span id="content"> Something Something Something Something Something Something Something Something Something Something Something<br> </span> </div> </div> </body> </html> Main.css .container { float:left; margin:20px; background:rgba(227,162,11,0.7); } .content-container { margin:20px; } #content { width:100px; font-size: 18px; color: #333333; }
  7. Oh my. Thanks a bunch. I'll never forget this neat trick. Thanks a lot psycho.
  8. *bows* Ok that is working now. How did you figure it out ?
  9. Mate, I think you are seeing something i'm not able to. What i'm seeing is pagination happens using the same js function and i'm not able to traverse through pages using Php. I thought about doing the same you suggested but i wasn't able to, thus i posted here <a id="next-n-start" href="javascript:void(0);" onclick="reloadSection('#start=10', 'ps-sellers');" onmousedown="return logClick('\x2Fproducts\x2Fcatalog?hl=de\x26q=4242002690209\x26cid=2594634728159287170\x26cpo=1\x26sa=N\x26start=10', 'cc', 'Overview', 'tabless', '2594634728159287170', 'ps-sellers-frame_Weiter \x26raquo\x3B')" >Weiter ยป</a> Little more help would be appreciated.
  10. I wanted to do that, however because of the javascript pagination im unable to do that. There are 38 results and it shows first 10 results. Can you please give me a lead on how to surf through next results via php.
  11. Code im using <?php $get_EAN = '4242002690209'; $url = "http://www.google.de/search?hl=de&tbm=shop&q=".$get_EAN."&oq=".$get_EAN; $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_USERAGENT, "spider"); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $get_product = curl_exec ($ch); curl_close ($ch); preg_match_all('~<div class="pslimain"><h3 class="r"><a href="(.*?)"~s', $get_product, $get_price); if(preg_match('#cid=(.*)#', $get_price[1][0], $r)) { $get_cid = trim($r[1]); } $url = "http://www.google.de/products/catalog?hl=de&q=4242002690209&cid=".$get_cid; $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_USERAGENT, "spider"); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $list_price = curl_exec ($ch); curl_close ($ch); print_r($get_price[1][0]); print_r($get_product); print_r($list_price); ?>
  12. I'm trying to scrape data from google.de/shopping. Consider the following URL http://www.google.de/products/catalog?hl=de&q=4242002690209&cid=2594634728159287170 I need to sort this product list with 'Endpreis' (if you don't translate German to English). I need the lowest of all. Clicking it on a normal browser gets the job done as it does this using javascript. However while scraping using Php it doesn't sort it. Obviously, I need to check the javascript involved and i did. Here is my analysis. When i check the javascript document named ps-js.js i get the function logClick. D("logClick",function(a,b,c,d,e,f){document.images&&((new Image).src=gb("/products/log","?ptab=pp_click","&pp_exp=",d,"&pp_vert=",b,"&pp_sec=",c,"&pp_lk=",f,"&cid=",e,"&pp_durl=",a));return j}) Corresponding html for it is href="javascript:void(0);" onclick="reloadSection('#scoring=tps', 'ps-sellers');" onmousedown="return logClick('\x2Fproducts\x2Fcatalog?hl=de\x26q=4242002690209\x26cid=2594634728159287170\x26scoring=tps', 'cc', 'Overview', 'tabless', '2594634728159287170', 'Endpreis')" class="">Endpreis</a> When i input the value http://www.google.de/products/log?ptab=pp_click&pp_exp=tabless&pp_vert=cc&pp_sec=Overview&pp_lk=Endpreis&cid=2594634728159287170 Nothing happens. Any workaround or help to get the lowest Endpreis in the product list would be really appreciated. Thankyou
  13. Hey, I'm trying to scrape google.de/shopping . However I'm having following problem. Please check - view-source:http://www.google.de/search?hl=de&tbm=shop&q=4242002690209&oq=4242002690209 The url for the product is something like <a href="/products/catalog?hl=de&q=4242002690209&um=1&ie=UTF-8&tbm=shop&cid=2594634728159287170&sa=X&ei=5etEUJOlNI3zrQfuh4HADQ&ved=0CFYQ8wIwAA">Bosch MCM 42024 Red Diamond/Silber, Styline K?chenmaschine</a> And the url of the product i'm getting from my code is /products/catalog?hl=de&q=4242002690209&um=1&ie=UTF-8&tbm=shop&cid=2594634728159287170 Why is it that "&sa=X&ei=5etEUJOlNI3zrQfuh4HADQ&ved=0CFYQ8wIwAA" part is missing when im trying to scrape the url and where is it coming from ? P.S - In "&sa=X&ei=5etEUJOlNI3zrQfuh4HADQ&ved=0CFYQ8wIwAA" ei value changes everytime so try searching "Bosch MCM 42024 Red Diamond/Silber, Styline K?chenmaschine" while checking the source code. Code im using - <?php $get_EAN = '4242002690209'; $url = "http://www.google.de/search?hl=de&tbm=shop&q=".$get_EAN."&oq=".$get_EAN; $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_USERAGENT, "msn"); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $get_product = curl_exec ($ch); curl_close ($ch); preg_match_all('~<div class="pslimain"><h3 class="r"><a href="(.*?)"~s', $get_product, $get_price); $url = "http://www.google.de".$get_price[1][0]; $ch = curl_init(); curl_setopt ($ch, CURLOPT_URL, $url); curl_setopt ($ch, CURLOPT_USERAGENT, "msn"); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $list_price = curl_exec ($ch); curl_close ($ch); print_r($get_price[1][0]); //print_r($get_product); //print_r($list_price); ?>
×
×
  • 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.