1<?PHP 2require_once 'connect.inc'; 3 4// connect + select_db 5if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket)) { 6 printf("Cannot connect to the server using host=%s/%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s\n", 7 $host, $myhost, $user, $db, $port, $socket); 8 exit(1); 9} 10 11if (!mysql_query('DROP TABLE IF EXISTS test', $link)) { 12 printf("Failed to drop old test table: [%d] %s\n", mysql_errno($link), mysql_error($link)); 13 exit(1); 14} 15 16if (!mysql_query('CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE=' . $engine, $link)) { 17 printf("Failed to create test table: [%d] %s\n", mysql_errno($link), mysql_error($link)); 18 exit(1); 19} 20 21if (!mysql_query("INSERT INTO test(id, label) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')", $link)) { 22 printf("[%d] %s\n", mysql_errno($link), mysql_error($link)); 23} 24?> 25