Bonjour tout le monde

Voila j ai ete amene a effectuer des changements sur un site web, et j ai ce bout de php a modifier

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
<?php
 
  require_once('config.php');
 
  $connection_string = $config['dbdriver'] . ":dbname=" .
                       $config['database'] . ";host=" .
					   $config['hostname'];
 
  try
  {
    $connection = new PDO($connection_string,
                          $config['username'],
	     			      $config['password']);
  }
  catch(PDOException $e)
  {
    die($e->getMessage());   
  }
 
  $id = intval($_GET['id']);
 
  $stmt = $connection->prepare("SELECT offre.offre_ref, offre.offre_nomoper, offre.offre_desc, offre.offre_datelimit, offre.offre_datecreat, proced.proced_type, service.service_nom, service.service_email FROM offre, proced, service WHERE offre.fk_service = service.service_pk AND offre.fk_proced = proced.proced_pk AND offre.offre_pk = :id");
  $stmt->bindParam(":id", $id);
  $stmt->execute();
 
  $offre = $stmt->fetch(PDO::FETCH_NUM);
 
?>
et j ai fait ca pour etre "equivalent"

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
<?php
 
  require_once('config.php');
 
 
 
  @$cnx = mysql_connect(localhost, $config['username'], $config['password']) ;
if ( $cnx == 0 )	{
 	/* :-( database is out of order */
 	die ("<P><H2>".$txt[3]."</H2></P>\n<P>".$txt[4]."</P>\n") ;
}
 
if ( mysql_select_db(sta_mairie, $cnx) == false )
	die ("<P><H2>".$txt[3]."</H2></P>\n<P>".$txt[39]."</P>\n") ;
 
 
  $id = intval($_GET['id']);
 
  $stmt = mysql_prepare("SELECT offre.offre_ref, offre.offre_nomoper, offre.offre_desc, offre.offre_datelimit, offre.offre_datecreat, proced.proced_type, service.service_nom, service.service_email FROM offre, proced, service WHERE offre.fk_service = service.service_pk AND offre.fk_proced = proced.proced_pk AND offre.offre_pk = :id");
  mysql_stmt_bind_Param($stmt, ":id", $id);
  mysql_stmt_execute($stmt);
 
  $offre = mysql_fetch(mysql_fetch_row($stmt));
 
?>
je débute, je concède et il y a surement des erreurs,je vous demande de me dire ou et de m expliquer, d avance GRAND MERCI a tous