This is the link the sends the $Row[pk_tId] to javascript:
<a class=\"open-EditRow btn btn-primary btn-mini\" data-toggle=\"modal\" href=\"#myEditModal\" data-id=\"".$Row[pk_tId]."\" title=\"Edit this row\" \">Delete/Edit</a></td>";
This is the javascript that sends $Row[pk_tId] as groupId to the modal (on the same page):
$(document).on("click", ".open-EditRow", function () {
var myGroupId = $(this).data('id');
$(".modal-body #groupId").val( myGroupId );
});
This is the input field inside the modal that prints groupId:
$id = "<input type=\"text\" name=\"groupId\" id=\"groupId\" value=\"\" />";
I echo out the $id:
echo "Your id is: " . $id;
But when I try to select the $id to pull the record out of the database, it returns no records. The record is there. Here is the statement:
$q = "SELECT * FROM restable WHERE pk_tId == '" . $id . "'";
if (mysql_num_rows($q) == 0){
echo "No results";
}
The only thing I get is "No results." I have a steady connection to the database. Why isn't this statement returning anything? What am I missing? Please help.