1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Have all searches caught -> then displayed on a page

Discussion in 'PHP' started by Al Capone, Aug 13, 2005.

  1. Al Capone

    Al Capone Well-Known Member

    Messages:
    784
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    140
    #21
    Ok, I did some reading and I got the database connected but now I get this error

    Unknown column 'query' in 'field list'
    SEMrush
    I put this code:


    In the search script, what am I doing wrong right now, I am still offering the $10 to whoever helps me get this to work, thanks.
     
    Al Capone, Aug 16, 2005 IP
    SEMrush
  2. daed

    daed Peon

    Messages:
    93
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #22
    Yeah, that's easy.. You have to build the table and make sure there is a field called 'query' inside of it. I would name the table something more descriptive though. You can easily use phpMyAdmin to build the tables.
     
    daed, Aug 17, 2005 IP
  3. Al Capone

    Al Capone Well-Known Member

    Messages:
    784
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    140
    #23
    Thanks daed

    I am so close I can just taste it! Thanks guys, one problem now, the tables I made look like this

    these three I just guessed on for type, I just guessed varchar(200):

    the reason I am telling you this is because this might be why I am having this problem over here, when I use the display part of the script this is all that shows up on the page:

    I am guessing it is because I selected something wrong when I created the table `query` `time` and `ftime` maybe varchar(200) was wrong or something could someone tell me why I am getting a bunch of numbers?

    Thanks so much.
     
    Al Capone, Aug 17, 2005 IP
  4. Al Capone

    Al Capone Well-Known Member

    Messages:
    784
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    140
    #24
    Ok, I fixxed the problem where it didn't show the time the search was made so now it shows this:

    but still it's showing numbers instead of the actual words that are being searched, anyone have a clue why?

    Thanks so much
     
    Al Capone, Aug 17, 2005 IP
  5. Al Capone

    Al Capone Well-Known Member

    Messages:
    784
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    140
    #25
    I think only mck will know the solution to this because he gave me the script, whoever can help me get this thing online get 10 bucks (through pay pal only), I know its not much but its all I can afford, its still good money for a couple minutes of time.

    Thanks
     
    Al Capone, Aug 18, 2005 IP
  6. Al Capone

    Al Capone Well-Known Member

    Messages:
    784
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    140
    #26
    I am really serious about doing this so if anyone knows please help, Ic have been trying to get this done for about a week straight now I haven't had time to work on anything else.

    Please help, thank.
     
    Al Capone, Aug 18, 2005 IP
  7. Al Capone

    Al Capone Well-Known Member

    Messages:
    784
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    140
    #27
    Ok, I think I know where the problem lies...

    The file above is my full search scripts result page, you see the red? I checked the mySQL database and everything records, the date, the ftime, everything except the query, am I suppose to rename something in this line? and if so what do I rename it too?:

    See here, I get everything to show up, except the query: (QUERY SHOULD BE HERE ) - August 19 2005 12:43 AM - 1124430192

    Thanks very much, $10 is still up for grabs to whoever is responsible for me getting this script online.
     
    Al Capone, Aug 18, 2005 IP
  8. Nitin M

    Nitin M White/Gray/Black Hat

    Messages:
    640
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #28
    Al,

    I admire your tenacity. Keep it up! :)


    You must have a form on your site where the user enters their search terms. On that page is going to be something like <input type="text" name="criteria" size="20">

    In my example my form field is named 'criteria'. Look at your form and see what the name is. That's what you need to substitute in for 'searchfield'.

    Good luck!
     
    Nitin M, Aug 18, 2005 IP
  9. Al Capone

    Al Capone Well-Known Member

    Messages:
    784
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    140
    #29
    God bless you man, it worked, if you want 10 bucks just post your Pay Pal account.

    But does anyone know how I can restrict duplicated searches showing?
     
    Al Capone, Aug 18, 2005 IP
  10. Nitin M

    Nitin M White/Gray/Black Hat

    Messages:
    640
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #30
    Don't want the 10 bucks, but thanks for offering.

    In order to not display the duplicates you have to change your output code:

    Needs to become something like:
    //Now for the displaying stuff
    $getit = mysql_query("SELECT DISTINCT query FROM `table` ORDER BY `query`") or die(mysql_error());
    while($get = mysql_fetch_array($getit))
    {
    $query = $get['query'];
    // NOT USED ANYMORE -> $time =  $get['time'];
    // NOT USED ANYMORE -> $ptime = $get['ptime'];
    echo("$query");
    PHP:
     
    Nitin M, Aug 19, 2005 IP
    JoeO likes this.
  11. Al Capone

    Al Capone Well-Known Member

    Messages:
    784
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    140
    #31
    Awsome, thanks so much :) it worked, can't tell you how thankful I am, thanks :)
     
    Al Capone, Aug 19, 2005 IP