Jump to content

Short select statements?


Recommended Posts

I have always wondered if there is a way of doing a quicker select statement than the one below;

 

$userID = $_GET['userID'];

$result = mysql_query("SELECT name FROM users WHERE userID = $userID");
$row = mysql_fetch_row($result);

echo $row[0];

 

 

Can this query be shortened for simple queries like this one where I just want to retrieve a single field from one row?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.