Well, first of all, you should not be using mysql_*
extension because it is deprecated. You're also vulnerable to SQL injection because you're not escaping your inputs.
Regarding about Resource id #4
, it is a resource returned by your mysql_query()
call, not an actual row object/array (source).
If you want to get an object/array, you need to add an additional line:
$keytest = mysql_fetch_array($keytest);
Now your $keytest
is an object/array (array more likely). To get value from this array, you need to specify array's key. For example, if you have a column called unique_id
, then you can echo
it by writing something like:
echo 'Token unique ID: '.$keytest['unique_id'];
That's it about how to retrieve data. But as I have said earlier, you should not use mysql_*
, better is to use either prepared statements or mysqli_*.