2
It's only a matter of personal preference. Using sprintf is more time-consuming than simple string concatenation, but I doubt that the difference is significant.
My preference is:
$table = $xoopsDB->prefix("partners");
$xoopsDB->query("DELETE FROM $table WHERE id = '$id'");
Or for complex queries that don't fit nicely on one line:
$result = $xoopsDB->query("
SELECT a, b, c
FROM $table
WHERE d = 'foo' AND e = 'bar'
ORDER BY f DESC
LIMIT 30
");
Note that having a line break in between the opening " and SELECT requires a trivial change to class XoopsMySQLDatabaseProxy::query.
I think the primary objective should be to make the code readable.