Scripts pour insérer un enregistrement
ASP |
JSP |
PHP |
1 <% 2 Set conn = Server.CreateObject("ADODB.Connection") 3 conn.Open "accessDSN" 4 5 sqlString = "INSERT INTO produits (nom, prix ) " 6 "values ( 'Panier cadeau', 149.5 )" 7 Con.Execute sqlString 8 Con.close 9 %> |
1 <% Driver mysql_driver = 2 (Driver)Class.forName("org.gjt.mm.mysql.Driver").newInstance(); 3 Connection conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/shopDB",”root”,””); 4 5 sqlString = "INSERT INTO produits (nom, prix ) "+ 6 "values ( 'Panier cadeau', 149.5 )" 7 PreparedStatement statement = conn.prepareStatement(sqlString); 8 statement.executeUpdate(); 9 conn.close(); |
1 <? 2 $conn = mysql_pconnect('localhost', 'root', '') 3 4 sqlString = "INSERT INTO produits (nom, prix ) ". 5 "values ( 'Panier cadeau', 149.5 )" 6 mysql_query($sqlString , $conn); 7 ?> |
Analyse ASP
Analyse PHP
Analyse JSP