We help IT Professionals succeed at work.
Get Started

Jquery and PHP

Last Modified: 2013-12-12
I am working on an update of our recruitment site as am looking into using a dropdown to allow the user to access the content. I have gotten the drop down working fine I just can't work out a way to get the usage stats that we currently have from when users view an advert.

How can I get a one added to the correct entry when a user clicks through? I am using jquery and php with a mysql database.

For example a user clicks on our top job ad the content unfurls below the job title and a click is registered in our database to show that someone has viewed it.

For all I know this could be done solely with javascript but my jscript knowledge is in its infancy.
<script src="http://code.jquery.com/jquery-latest.js"></script>
$(document).ready(function() {
$('a.linka').click(function() {
        var id = $(this).attr('id');
     $('#linkbox' + id).toggle(500);
        // alert(id);
     return false;
<div class="linkbar"><a href="'.$reclist['jobID'].'" id="'.$reclist['jobID'].'" class="linka" name="'.$reclist['jobID'].'" style="color:#BA3F3F">'.$reclist['jobTitle'].'</a></div>
if (!empty($reclist['logo'])) { echo '<img src="mysite/images/recruitment/logos/'.$reclist['logo'].'"'; if($width > 150){ echo ' width="150">'; }else{ echo 'height="70">'; }} echo'
<td colspan="4">
<div id="linkbox'.$reclist['jobID'].'" class="linkbox" style="display:none">

Open in new window

Watch Question
Expert of the Year 2008
Top Expert 2008
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE