asp to php
| From: | Harpreet | Date: | Tue, 09 Oct 2001 18:39:16 +0000 |
| Subject: | asp to php | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-13150@lists.php.net to get a copy of this message | ||
I have an asp page and am trying to convert my asp code to php.
my asp code is as follows:
<% ' Check for message alerts for Traffic Area
sqlstr = "SELECT COUNT(*) TOTAL FROM MSG_OPERATOR_TBL WHERE PRIORITY >=
1000 AND READ_FLAG = 'N' AND TYPE = 'TR'"
if Session("ObjectRecordset").State = 1 then
Session("ObjectRecordset").Close
Session("ObjectRecordset").Open sqlstr, Session("ObjectConnection")
total1 = Session("ObjectRecordset")("TOTAL")
Session("ObjectRecordset").Close
%>
The php code so far is:
<?php
// Check for message alerts for Traffic Area
$StrConnectionUser=mysql_connect("ip address","$USER");
mysql_select_db(databasename, $StrConnectionUser);
$sqlstr="SELECT COUNT(*) TOTAL FROM MSG_OPERATOR_TBL WHERE PRIORITY >= 1000
AND READ_FLAG = 'N' AND TYPE = 'TR'";
$result=mysql_query($sqlstr);
?>
How do i get the value of TOTAL from the above query.
Please help,
Regards,
Harpreet Kaur
Software Developer
Crispin Corporations Inc.