Lines Matching refs:mysqli

2 mysqli->affected_rows
4 mysqli
13 $mysqli = new mysqli();
15 $mysqli->affected_rows;
20 if (!$mysqli = new my_mysqli($host, $user, $passwd, $db, $port, $socket)) {
25 if (0 !== ($tmp = $mysqli->affected_rows))
28 if (!$mysqli->query('DROP TABLE IF EXISTS test'))
29 printf("[003] [%d] %s\n", $mysqli->errno, $mysqli->error);
31 …if (!$mysqli->query('CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE = ' . $engin…
32 printf("[004] [%d] %s\n", $mysqli->errno, $mysqli->error);
34 if (!$mysqli->query("INSERT INTO test(id, label) VALUES (1, 'a')"))
35 printf("[005] [%d] %s\n", $mysqli->errno, $mysqli->error);
37 if (1 !== ($tmp = $mysqli->affected_rows))
41 $mysqli->query("INSERT INTO test(id, label) VALUES (1, 'a')");
42 if (-1 !== ($tmp = $mysqli->affected_rows))
45 … if (!$mysqli->query("INSERT INTO test(id, label) VALUES (1, 'a') ON DUPLICATE KEY UPDATE id = 4"))
46 printf("[008] [%d] %s\n", $mysqli->errno, $mysqli->error);
48 if (2 !== ($tmp = $mysqli->affected_rows))
51 if (!$mysqli->query("INSERT INTO test(id, label) VALUES (2, 'b'), (3, 'c')"))
52 printf("[010] [%d] %s\n", $mysqli->errno, $mysqli->error);
54 if (2 !== ($tmp = $mysqli->affected_rows))
57 if (!$mysqli->query("INSERT IGNORE INTO test(id, label) VALUES (1, 'a')")) {
58 printf("[012] [%d] %s\n", $mysqli->errno, $mysqli->error);
61 if (1 !== ($tmp = $mysqli->affected_rows))
64 if (!$mysqli->query("INSERT INTO test(id, label) SELECT id + 10, label FROM test"))
65 printf("[014] [%d] %s\n", $mysqli->errno, $mysqli->error);
67 if (4 !== ($tmp = $mysqli->affected_rows))
70 if (!$mysqli->query("REPLACE INTO test(id, label) values (4, 'd')"))
71 printf("[015] [%d] %s\n", $mysqli->errno, $mysqli->error);
73 if (2 !== ($tmp = $mysqli->affected_rows))
76 if (!$mysqli->query("REPLACE INTO test(id, label) values (5, 'e')"))
77 printf("[017] [%d] %s\n", $mysqli->errno, $mysqli->error);
79 if (1 !== ($tmp = $mysqli->affected_rows))
82 if (!$mysqli->query("UPDATE test SET label = 'a' WHERE id = 2"))
83 printf("[019] [%d] %s\n", $mysqli->errno, $mysqli->error);
85 if (1 !== ($tmp = $mysqli->affected_rows))
88 if (!$mysqli->query("UPDATE test SET label = 'a' WHERE id = 2")) {
89 printf("[021] [%d] %s\n", $mysqli->errno, $mysqli->error);
92 if (0 !== ($tmp = $mysqli->affected_rows))
95 if (!$mysqli->query("UPDATE test SET label = 'a' WHERE id = 100")) {
96 printf("[023] [%d] %s\n", $mysqli->errno, $mysqli->error);
99 if (0 !== ($tmp = $mysqli->affected_rows))
102 if (!$mysqli->query('DROP TABLE IF EXISTS test'))
103 printf("[025] [%d] %s\n", $mysqli->errno, $mysqli->error);
105 $mysqli->close();
108 $mysqli->affected_rows;