Connect to database and change value upon clicking table row

  javascript, mysqli, php

I am trying to connect the third column in the table (all have class "plus") to my phpmyadmin database. The database has the default value "no" for each city, and upon clicking the plus sign in the table, I want to change the database value to "yes." The first column in the database is the user’s username (it’s a social media site), so if there is a way that I should incorporate that into the code, that would be great too.

I currently have no PHP code; I’ve tried all sorts of different things, and can connect to the database find, but cannot get the database value to change. Maybe javascript is needed too? Any help would be appreciated!

HTML:

        <tr>
            <td>
                <img src="">
            </td>
            <td class="albuquerque">
                <b>Albuquerque</b>
            </td>
            <td>
                <div class="plus">
                    &plus;
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <img src="">
            </td>
            <td class="atlanta">
                <b>Atlanta</b>
            </td>
            <td>
                <div class="plus">
                    &plus;
                </div>
            </td>
        </tr>
        <tr>
            <td>
                <img src="">
            </td>
            <td class="baltimore">
                <b>Baltimore</b>
            </td>
            <td>
                <div class="plus">
                    &plus;
                </div>
            </td>
        </tr>

Source: Ask Javascript Questions

LEAVE A COMMENT