Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 947611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:06:27+00:00 2026-05-15T23:06:27+00:00

I am trying to send link id’s to a sql query in order to

  • 0

I am trying to send link id’s to a sql query in order to filter data.

When I click a link like the ones below, I want to send the id of the link to the sql query as shown below:

Example:
Links (clicked):

<p>Fitler Results</p>
<a href="#" class="category" id="marketing">Marketing</a>

<a href="#" class="category" id="automotive">Automotive</a>

(not clicked):

<a href="#" class="category" id="sports">Sports</a>

sql query – I hardcoded the id’s in, but I want it to do that automatically when someone clicks a link, in this case marketing and automotive, I want the id’s to insert automatically using jquery but have no idea how to properly do it:

$query1 = "SELECT * FROM explore WHERE category IN ('marketing', 'automotive',) ORDER BY category LIMIT $start, $limit";
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:06:28+00:00Added an answer on May 15, 2026 at 11:06 pm

    just do a jquery ajax post with a return false, and capture the result.

    $('a').click(function(){
      $.post("querypage.php", { id: "$(this).attr('id')"},
         function(data){
           dosomethingwithdata(data);
      });
     //return false to insure the page doesn't refresh
     return false;
    });
    

    Then in your php page (=querypage.php) do:

    $query1 = "SELECT * FROM explore WHERE".$_POST["id"]."IN ('marketing', 'automotive',) ORDER BY category LIMIT $start, $limit";
    

    offcourse you now have to execute the query and return the result you want.

    I hope this helps, comment me if there is any problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey I am trying to send an email on the click of a link...
I'm trying to send post using API feed. I set fields: message , link
I am trying to grab the closest link with the class a.tariff-link and send
I`m trying to send simple html page with form data to user with GET,
I'm trying to send an email using codeigniter, and would like the message to
Im trying to use JS to send data to my Flash AS2.0 music player
I am trying to send email - which is working correctly, but my Click
I'm trying to send data from client-side to server-side (asp.net c#), if you really
http://www.hccp.org/java-net-cookie-how-to.html According to this link I was trying to create cookie and send cookie
I'm trying to send unique links through facebook, but I want the option to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.