Topic: Don't know if I'm using the query right
I have this following code for a query on a page I am making:
$from = $db->query('SELECT username FROM '.$db->prefix.'users WHERE id='.$senderid) or error('Cannot find user', __FILE__, __LINE__, $db->error());
Let me explain it a little bit:
- I have a user's ID sent to a database. The ID saves correctly, and I've checked that. But, when I use this query to select a username from the database by the ID all I get is the result "Resource id #17". Is there something that I am doing wrong that I should edit the code by?
Thanks!