Jump to content

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
https://forums.phpfreaks.com/topic/60732-short-select-statements/
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.