Hi!
>MySQL provides three transaction-safe tables including Berkeley_DB, GEMINI
>and InnoDB Tables, I have some queries on them:
>1. What are the differences between these three type of transaction-safe
> table types?
BDB has only page level locks, InnoDB has row level locks and an Oracle-
style consistent non-locking read, Gemini has row level locks.
>2. Which type should be used for the E-Commerce web site?
Use a transactional table type, but I am biased to give any further
opinion.
>3. Is true that BDB is free while the other two are not free?
No it is not true. InnoDB is published under the same GNU GPL license
as MySQL itself.
>4. In MySQL, we can use transaction as the following:
> BEGIN;
> SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
> UPDATE table2 SET summmary=@A WHERE type=1;
> COMMIT; (or ROLLBACK)
>
> but how to apply it in the E-Commerce web site with PHP programming?
>From the PHP website www.php.net I found the following example.
<?php
$link = mysql_connect("mysql_host", "mysql_login", "mysql_password")
or die ("Could not connect");
print ("Connected successfully");
mysql_select_db ("my_database")
or die ("Could not select database");
$query = "SELECT * FROM my_table";
$result = mysql_query ($query)
or die ("Query failed");
// printing HTML result
print "<table>\n";
while($line = mysql_fetch_array($result)){
print "\t<tr>\n";
while(list($col_name, $col_value) = each($line)){
print "\t\t<td>$col_value</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
mysql_close($link);
?>
Best regards,
Heikki
http://www.innodb.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php