RE: [PHP-DB] asp to php
| From: | Harpreet | Date: | Tue, 09 Oct 2001 19:10:22 +0000 |
| Subject: | RE: [PHP-DB] asp to php | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-13154@lists.php.net to get a copy of this message | ||
I used the asp2php program to convert my page but ti doesnt seem to mak
sense to me. Like the query works fine but now i would like to print the
value on the screen.
My code is as follows:
$sqlstr="SELECT count(*) total from sys_parameter_tbl";
$result=mysql_query($sqlstr);
print total;
how can i print total??
help is appreciated.
regards,
Harpreet Kaur
Software Developer
Crispin Corporations Inc.
-----Original Message-----
From: Christopher J. Graham [mailto:cjgraham@tachegroup.com]
Sent: Tuesday, October 09, 2001 2:39 PM
To: harpreet@crispincorp.com; php-db@lists.php.net
Subject: Re: [PHP-DB] asp to php
FYI: Have you seen this page?
http://asp2php.naken.cc/
on 10/09/2001 2:39 PM, Harpreet at harpreet@crispincorp.com wrote:
> 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.
>
>
------------------------------------------------------------------------
Christopher Graham
cjgraham@tachegroup.com
PGP Fingerprint: F765 CCB5 B9CF 1285 7E3E 8CB0 0B1B 8454 9D66 D411