PMA_DBI_affected_rows
This commit is contained in:
@@ -9,6 +9,7 @@ $Source$
|
|||||||
* all concerned scripts: PMA_DBI_num_rows()
|
* all concerned scripts: PMA_DBI_num_rows()
|
||||||
* all concerned scripts: PMA_DBI_free_result()
|
* all concerned scripts: PMA_DBI_free_result()
|
||||||
* all concerned scripts: PMA_DBI_insert_id()
|
* all concerned scripts: PMA_DBI_insert_id()
|
||||||
|
* all concerned scripts: PMA_DBI_affected_rows()
|
||||||
|
|
||||||
2004-01-19 Marc Delisle <lem9@users.sourceforge.net>
|
2004-01-19 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* libraries/common.lib.php, libraries/dbi/mysql.dbi.lib.php:
|
* libraries/common.lib.php, libraries/dbi/mysql.dbi.lib.php:
|
||||||
|
@@ -213,4 +213,15 @@ function PMA_DBI_insert_id($link) {
|
|||||||
return mysql_insert_id($link);
|
return mysql_insert_id($link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function PMA_DBI_affected_rows($link) {
|
||||||
|
if (empty($link)) {
|
||||||
|
if (isset($GLOBALS['userlink'])) {
|
||||||
|
$link = $GLOBALS['userlink'];
|
||||||
|
} else {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mysql_affected_rows($link);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -278,7 +278,7 @@ if ($sql_query != '') {
|
|||||||
}
|
}
|
||||||
} else if ($cfg['VerboseMultiSubmit']) {
|
} else if ($cfg['VerboseMultiSubmit']) {
|
||||||
$a_num_rows = (int)@PMA_DBI_num_rows($result);
|
$a_num_rows = (int)@PMA_DBI_num_rows($result);
|
||||||
$a_aff_rows = (int)@mysql_affected_rows();
|
$a_aff_rows = (int)@PMA_DBI_affected_rows();
|
||||||
if ($a_num_rows > 0) {
|
if ($a_num_rows > 0) {
|
||||||
$a_rows = $a_num_rows;
|
$a_rows = $a_num_rows;
|
||||||
$a_switch = $strRows . ': ';
|
$a_switch = $strRows . ': ';
|
||||||
|
@@ -596,7 +596,7 @@ if (!empty($adduser_submit) || !empty($change_copy)) {
|
|||||||
$local_query = 'SELECT "foo" FROM `user` WHERE `User` = "' . PMA_sqlAddslashes($username) . '" AND `Host` = "' . $hostname . '";';
|
$local_query = 'SELECT "foo" FROM `user` WHERE `User` = "' . PMA_sqlAddslashes($username) . '" AND `Host` = "' . $hostname . '";';
|
||||||
$res = PMA_mysql_query($local_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $local_query);
|
$res = PMA_mysql_query($local_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $local_query);
|
||||||
unset($local_query);
|
unset($local_query);
|
||||||
if (mysql_affected_rows($userlink) == 1) {
|
if (PMA_DBI_affected_rows($userlink) == 1) {
|
||||||
$message = sprintf($strUserAlreadyExists, '<i>\'' . $username . '\'@\'' . $hostname . '\'</i>');
|
$message = sprintf($strUserAlreadyExists, '<i>\'' . $username . '\'@\'' . $hostname . '\'</i>');
|
||||||
$adduser = 1;
|
$adduser = 1;
|
||||||
} else {
|
} else {
|
||||||
@@ -1018,7 +1018,7 @@ if (empty($adduser) && empty($checkprivs)) {
|
|||||||
}
|
}
|
||||||
echo '</h2>' . "\n";
|
echo '</h2>' . "\n";
|
||||||
$res = PMA_mysql_query('SELECT "foo" FROM `user` WHERE `User` = "' . PMA_sqlAddslashes($username) . '" AND `Host` = "' . $hostname . '";', $userlink);
|
$res = PMA_mysql_query('SELECT "foo" FROM `user` WHERE `User` = "' . PMA_sqlAddslashes($username) . '" AND `Host` = "' . $hostname . '";', $userlink);
|
||||||
if (mysql_affected_rows($userlink) <= 0) {
|
if (PMA_DBI_affected_rows($userlink) <= 0) {
|
||||||
echo $strUserNotFound;
|
echo $strUserNotFound;
|
||||||
require_once('./footer.inc.php');
|
require_once('./footer.inc.php');
|
||||||
}
|
}
|
||||||
@@ -1057,7 +1057,7 @@ if (empty($adduser) && empty($checkprivs)) {
|
|||||||
$sql_query = 'SELECT `Table_name`, `Table_priv`, IF(`Column_priv` = "", 0, 1) AS "Column_priv" FROM `tables_priv` WHERE `Host` = "' . $hostname . '" AND `User` = "' . PMA_sqlAddslashes($username) . '" AND `Db` = "' . $dbname . '" ORDER BY `Table_name` ASC;';
|
$sql_query = 'SELECT `Table_name`, `Table_priv`, IF(`Column_priv` = "", 0, 1) AS "Column_priv" FROM `tables_priv` WHERE `Host` = "' . $hostname . '" AND `User` = "' . PMA_sqlAddslashes($username) . '" AND `Db` = "' . $dbname . '" ORDER BY `Table_name` ASC;';
|
||||||
}
|
}
|
||||||
$res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
|
$res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
|
||||||
if (mysql_affected_rows($userlink) == 0) {
|
if (PMA_DBI_affected_rows($userlink) == 0) {
|
||||||
echo ' <tr>' . "\n"
|
echo ' <tr>' . "\n"
|
||||||
. ' <td bgcolor="' . $cfg['BgcolorOne'] . '" colspan="6"><center><i>' . $strNone . '</i></center></td>' . "\n"
|
. ' <td bgcolor="' . $cfg['BgcolorOne'] . '" colspan="6"><center><i>' . $strNone . '</i></center></td>' . "\n"
|
||||||
. ' </tr>' . "\n";
|
. ' </tr>' . "\n";
|
||||||
|
2
sql.php
2
sql.php
@@ -338,7 +338,7 @@ else {
|
|||||||
if (!$is_affected) {
|
if (!$is_affected) {
|
||||||
$num_rows = ($result) ? @PMA_DBI_num_rows($result) : 0;
|
$num_rows = ($result) ? @PMA_DBI_num_rows($result) : 0;
|
||||||
} else if (!isset($num_rows)) {
|
} else if (!isset($num_rows)) {
|
||||||
$num_rows = @mysql_affected_rows();
|
$num_rows = @PMA_DBI_affected_rows();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Checks if the current database has changed
|
// Checks if the current database has changed
|
||||||
|
@@ -215,8 +215,8 @@ foreach($query AS $query_index => $single_query) {
|
|||||||
PMA_mysqlDie($error, '', '', $err_url);
|
PMA_mysqlDie($error, '', '', $err_url);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (@mysql_affected_rows()) {
|
if (@PMA_DBI_affected_rows()) {
|
||||||
$total_affected_rows += @mysql_affected_rows();
|
$total_affected_rows += @PMA_DBI_affected_rows();
|
||||||
}
|
}
|
||||||
|
|
||||||
$insert_id = PMA_DBI_insert_id();
|
$insert_id = PMA_DBI_insert_id();
|
||||||
|
Reference in New Issue
Block a user