Click here to Skip to main content
12,074,808 members (57,857 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: ASP PHP
Hi,

Would anyone be so kind to convert my php into asp please?

Greatly appreciated.
James

<?
$objConnect = mysql_connect("***","***","***") or die(mysql_error());
$objDB = mysql_select_db("***");
 
//*** Add ***//
if($_POST["hdnCmd"] == "Add")
{
$strSQL = "INSERT INTO xxxxxxx ";
$strSQL .="(ID,StartDateTime,EndDateTime,Name,Email,Telephone,SMS,Sex) ";
$strSQL .="VALUES ";
$strSQL .="('".$_POST["txtAddID"]."','".$_POST["txtAddStart"]."','".$_POST["txtAddEnd"]."','".$_POST["txtAddName"]."' ";
$strSQL .=",'".$_POST["txtAddEmail"]."' ";
$strSQL .=",'".$_POST["txtAddTelephone"]."','".$_POST["txtAddSMS"]."' ";
$strSQL .=",'".$_POST["txtAddSex"]."') ";
$objQuery = mysql_query($strSQL);
if(!$objQuery)
{
echo "Error Save [".mysql_error()."]";
}
//header("location:$_SERVER[PHP_SELF]");
//exit();
}
 
//*** Update ***//
if($_POST["hdnCmd"] == "Update")
{
$strSQL = "UPDATE xxxxxxx SET ";
$strSQL .="ID = '".$_POST["txtEditID"]."' ";
$strSQL .=",StartDateTime = '".$_POST["txtEditStart"]."' ";
$strSQL .=",EndDateTime = '".$_POST["txtEditEnd"]."' ";
$strSQL .=",Name = '".$_POST["txtEditName"]."' ";
$strSQL .=",Email = '".$_POST["txtEditEmail"]."' ";
$strSQL .=",Telephone = '".$_POST["txtEditTelephone"]."' ";
$strSQL .=",SMS = '".$_POST["txtEditSMS"]."' ";
$strSQL .=",Sex = '".$_POST["txtEditSex"]."' ";
$strSQL .="WHERE ID = '".$_POST["hdnEditID"]."' ";
$objQuery = mysql_query($strSQL);
if(!$objQuery)
{
echo "Error Update [".mysql_error()."]";
}
//header("location:$_SERVER[PHP_SELF]");
//exit();
}
 
//*** Delete ***//
if($_GET["Action"] == "Del")
{
$strSQL = "DELETE FROM xxxxxxx ";
$strSQL .="WHERE ID = '".$_GET["CusID"]."' ";
$objQuery = mysql_query($strSQL);
if(!$objQuery)
{
echo "Error Delete [".mysql_error()."]";
}
//header("location:$_SERVER[PHP_SELF]");
//exit();
}
 
$strSQL = "SELECT * FROM xxxxxxx order by ID";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
Posted 25-Jan-13 1:24am
J3ffers210
Edited 25-Jan-13 1:26am
v2
Comments
aspnet_regiis -i 25-Jan-13 6:29am
   
You have posted it at the wrong place. You need to post it here ^
Milind_T 25-Jan-13 6:42am
   
Well J3ffers, you need to outsource to someone. At CP, you ask for help in case you are stuck somewhere.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Convert PHP to ASP[^] online convert from here
  Permalink  
Comments
J3ffers 25-Jan-13 6:35am
   
Thanks Abhishek, I've tried that and it spits out a few errors.
Abhishek Pant 25-Jan-13 6:53am
   
Insert the id labels directly on that code.I think that will resolve your error.
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

Paid someone.. not really was just trying my luck as I have little to no experience in asp.. cheers anyway guys..
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160208.1 | Last Updated 9 Jul 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100