Is it possible, accidentally or on purpose, to pass a
wildcard to this function that would have the effect
of deleting many or all rows (shortname is a unique,
non-null field)?
function delete_row_by_s hortname($table ,$shortname){
global $mysqlhost, $mysqlusr, $mysqlpw, $mysqldb;
$link = mysql_connect($ mysqlhost, $mysqlusr, $mysqlpw);
if (!$link) {
die('Not connected : ' . mysql_error());
}
mysql_select_db ($mysqldb) or
die ('Could not select database:' . "$mysqldb." );
$query = "DELETE FROM $table WHERE shortname='$sho rtname'";
mysql_query($qu ery) or die ("Query Failed! mysql_error()") ;
$value = mysql_affected_ rows($link);
mysql_close($li nk);
return $value;
}
--
Lars Eighner <http://larseighner.com/ <http://myspace.com/larseighner>
Countdown: 586 days to go.
Why "War Czar"? That sounds like Imperial Russia!
Call it by the American term: "Fall Guy."
Comment