I need to change below code : PHP to ASP

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/67499?pagenum=1
05 November 2025, 02:34

Topic


kolucoms6
I need to change below code : PHP to ASP
21 July 2008, 13:41


<?
$objPage="select * from admins where admin_type='verification' and admin_manager=0 order by admin_id DESC";
$limitSql = mysql_query($objPage);
while($result2 = @mysql_fetch_array($limitSql))
{
$admin_id = $result2['admin_id'];
$admin_name= $result2['admin_name'];
if($admin_id==$result['assigned_to']){
echo '<option value='.$admin_id.' selected="selected">'.$admin_name.'</option>';
}else{
echo '<option value='.$admin_id.'>'.$admin_name.'</option>';
}
}
?>

<

 

Replies ...


kolucoms6
21 July 2008, 13:45


Database access data removed by ruirib: Are you trying to get hacked?!<
kolucoms6
21 July 2008, 17:17


No... I am NOT trying to hack.
My ASP form will pull out data from one SQL DB. DB admin gave me the PHP code whereas I need ASP code.<
kolucoms6
21 July 2008, 17:29



I have follwing details with me :

$db_host = "db_host";
$db_username = "uname";
$db_password = "password";
$db_name = "dbname";
table name is:client_leads


Can anyone please help me with the Connection string
<
kolucoms6
22 July 2008, 20:13


Any help ?<
Doug G
22 July 2008, 23:49


Originally posted by kolucoms6
Any help ?
Help with what? <
kolucoms6
23 July 2008, 04:52


Can anyone please help me with the Connection string
<
Carefree
23 July 2008, 05:04


Since I have no idea what information you are trying to extract, modify, insert or delete;
all I can do for you is to write a generic connection routine. Change the part in red to
the actual path of the database. Provided that the variable information you provided is
accurate, this will give you a list of all user names and passwords (if the passwords are
in cleartext format).
Code:

<%
Response.Write "<table align=""center"" border=""0"" width=""50%"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine &_
" <tr>" & vbNewLine &_
" <td width=""100%"" bgcolor=""cyan"">" & vbNewLine
" <table align=""center"" border=""0"" width=""100%"" cellspacing=""2"" cellpadding=""2"">" & vbNewLine &_
" <tr>" & vbNewLine

set my_Conn=Server.CreateObject("ADODB.Connection")
my_Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=path\dbname"
strSql = "SELECT UNAME, PASSWORD FROM " & strTablePrefix & "CLIENT_LEADS"
set rsDB=my_Conn.Execute(strSql)
rsDB.movefirst
Do until rsDB.EOF
Response.Write " <td width=""50%"" bgcolor=""white"">" & vbNewLine &_
" <br>" & rsDB("UNAME") & "</td>" & vbNewLine & _
" <td width=""50%"" bgcolor=""white"">" & vbNewLine &_
" <br>" & rsDB("PASSWORD") & "</td>" & vbNewLine
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine
rsDB.movenext
Loop
rsDB.close
set rsDB=nothing
Response.Write " </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
"</table>" & vbNewLine
Response.End
%>
<
kolucoms6
23 July 2008, 16:51


If sql server is password protected ?<
kolucoms6
23 July 2008, 17:17


Btw, SQL server is on 3rd party server<
Doug G
23 July 2008, 18:56


Ask your sql server admin for the proper connection string. <
© 2000-2021 Snitz™ Communications