sylesia Posted November 25, 2006 Share Posted November 25, 2006 Ok, so I have a query that comes up with quite an odd response when I echo it.<? $conn = mysql_connect("localhost", "x", "xx"); mysql_select_db("evaluation", $conn); $request = "SELECT EvaluatorName FROM yellowcard WHERE UserName = '$userName' AND CardNumber = '$cardNumber'"; $evalUser = mysql_query($request, $conn); echo $evalUser;?>Now, I have echoed $userName, $cardNumber and both show up fine. I have also run this query in MySQL and it comes up with the correct answer. Yet when this runs in php, I get thisResource id #4Now, I am not sure what the issue is, I have tested every part, even doing CardNumber = $cardNumber since it is an integer value, but that is what it keeps echoing each time I try to use it. Am I blind and missing something obvious, or what? Link to comment https://forums.phpfreaks.com/topic/28448-php-and-mysql/ Share on other sites More sharing options...
onlyican Posted November 25, 2006 Share Posted November 25, 2006 yes, thats cos you are not calling the results[code]<?php $conn = mysql_connect("localhost", "x", "xx"); mysql_select_db("evaluation", $conn); $request = "SELECT EvaluatorName FROM yellowcard WHERE UserName = '$userName' AND CardNumber = '$cardNumber'"; $evalUser = mysql_query($request, $conn);while($row = mysql_fetch_assoc($evalUser){echo $row["fieldname"]."<br />\n";}?>[/code]Where fieldname is the name of the field in myself Link to comment https://forums.phpfreaks.com/topic/28448-php-and-mysql/#findComment-130175 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.