mardi 8 mars 2016

Is there someway I could insert data in MSSQL using PHP?

Is there someway I could insert data in MSSQL using PHP ?

Here is the code for mysql , what changes could be done to insert data in MSSQL instead .. Thank You

<?php

$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

include("config.inc.php");
$link = mysql_connect($db_host,$db_user,$db_pass);
if(!$link) die ('Could not connect to database: '.mysql_error());
mysql_select_db($db_name,$link);
$query = "INSERT into `".$db_table."` (field_1,field_2,field_3,field_4) VALUES ('" . $_POST['field_1'] . "','" . $_POST['field_2'] . "','" . $_POST['field_3'] . "','" . $_POST['field_4'] . "')";
mysql_query($query);
mysql_close($link);

include("confirm.html");

?>

Aucun commentaire:

Enregistrer un commentaire