As usual thanks in advance. I've searched and searched for an answer to this but come up with a blank.
I know that the Variable $userId
is fine as when echoing it spits out the number 8. However when trying to use it within my Mysql command the array just comes up with a blank.
I took that into account when searching for a NULL entry into the array with the echo "Not";
but even that doesn't seem to echo out. Very strange. Is it simply that I need to change the way the $userId
variable is put into the mysql statement?
if($_SESSION['logged_in'] === "logged")
{
if(isset($_SESSION['id']))
{
$userId = $_SESSION['id'];
echo 'The User ID = ' . $userId . '<br>';
$musicidselect = mysql_query("SELECT * FROM myMusic WHERE user_id = '.$userId.'") or die(mysql_error());
while($data = mysql_fetch_array($musicidselect)){
if($data){
print_r($data);
} else{
echo "Not";
}
}
}
}
Am I having issues here simply because this file is loaded via jquery into another page?
<script type="text/javascript">
jQuery(document).ready(function($){
$("#performsearch").click(function(){
$("#displayresults").empty();
$( "#displayresults" )
.html('<center><img src="http://www.#######.com/wp-content/themes/bigformat/images/ajax-loader.gif"></center>')
.load( '/wp-content/themes/bigformat/template-home-search.php');
return false;
});
});
</script>