1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
$db = mysql_connect('localhost','root','root') or die ("Erreur de connexion");
mysql_select_db('mysql',$db) or die ("erreur de connexion base");
$req = mysql_query("SELECT Id,Year,Project,DocNumber,Entity,Kind,Ref from iso") or die ("Erreur SQL");
if (isset($_POST['Edit'])){
if ($_POST['Edit'] != "") {
print 'Edit Activé';
$Edit = $_POST['Edit'];
print ' Le Champ à modifier est :';
print $Edit;
if (isset($_POST['Year'])) {
if ($_POST['Year'] != "") {
$Year = $_POST['Year'];
mysql_query("Update iso Set Year ='$Year' where Id =$Edit ");}}
if (isset($_POST['Project'])) {
if ($_POST['Project'] != "") {
$Project = $_POST['Project'];
mysql_query("Update iso Set Project ='$Project' where Id =$Edit ");}}
if (isset($_POST['DocNumber'])) {
if ($_POST['DocNumber'] != "") {
$DocNumber = $_POST['DocNumber'];
mysql_query("Update iso Set DocNumber ='$DocNumber' where Id =$Edit ");}}
if (isset($_POST['Entity'])) {
if ($_POST['Entity'] != "") {
$Entity = $_POST['Entity'];
mysql_query("Update iso Set Entity ='$Entity' where Id =$Edit ");}}
if (isset($_POST['Kind'])) {
if ($_POST['Kind'] != "") {
$Kind = $_POST['Kind'];
mysql_query("Update iso Set Kind ='$Kind' where Id =$Edit ");}}
}
$EntityRef = mysql_query("SELECT Entity from iso where Id = $Edit");
$ProjectRef = mysql_query(("SELECT Entity from iso where Id = $Edit");
print $EntityRef;
$RefRefresh = $EntityRef.$ProjectRef;
mysql_query("Update iso Set Ref ='$RefRefresh' WHERE Id = $Edit ");
} |