note 42920 rejected from function.mysqli-commit by vincent
| From: | vincent@php.net | Date: | Thu, 10 Jun 2004 07:29:15 +0000 |
| Subject: | note 42920 rejected from function.mysqli-commit by vincent | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-70839@lists.php.net to get a copy of this message | ||
Note Submitter: mvalmeidas@bol.com.br
----
In Potuguese:
Congratulations to the people that power this site. This is the best! I would like to help
translate some things by this site to portuguese. May I help you ??? How can I do that??
Thanks!!!
Marcus Silva
I make a translate for an example to portuguese.see:
<?php
$con= mysqli_connect("localhost", "my_user", "my_password",
"test");
/* verifica conexão */
if (!$con) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
/* seta autocommit para off isso vai fazer com que só faça a transação se não houver erros*/
mysqli_autocommit($link, FALSE);
mysqli_query($con, "CREATE TABLE Language LIKE CountryLanguage Type=InnoDB");
/* Insere valores nas tabelas */
mysqli_query($con, "INSERT INTO Language VALUES ('DEU', 'Bavarian',
'F', 11.2)");
mysqli_query($con, "INSERT INTO Language VALUES ('DEU', 'Swabian',
'F', 9.4)");
/* Se chegar até aqui é por que deu tudo certo. Então pode efetuar a transação */
mysqli_commit($con);
/* fecha conexão */
mysqli_close($con);
?>