Jump to content

easiest way to get a single value from a database table?


townclown

Recommended Posts

info:Windows, Apache, PHP5, SQL Server 2005

 

Hi,

 

What is the quickest way to access a single value when querying a database.

 

$getMsgID = mssql_query("SELECT TOP (1) msgID FROM dbo.messages")or die("Couldn't access table");

 

Is there a quicker way to access that single value then doing something like:

$row = mssql_fetch_array($getMsgID);
$latestMsgID = $row['msgID']; 

Archived

This topic is now archived and is 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.