Skip to content

Commit

Permalink
Removed extra sprintf spaceholder [#24 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Leveille committed Feb 1, 2009
1 parent e820d45 commit 6ad47df
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions smc/core/libraries/Block.php
Expand Up @@ -46,7 +46,7 @@ public function create($data, $desc)
$mysql['data'] = $this->_db->real_escape_string($clean['data']);
$mysql['description'] = $this->_db->real_escape_string($clean['description']);

$sql=sprintf("INSERT INTO `%sblocks` (block, description) VALUES ('%s', '%s', %s)", Database::getTablePrefix(), $mysql['data'], $mysql['description']);
$sql=sprintf("INSERT INTO `%sblocks` (block, description) VALUES ('%s', '%s')", Database::getTablePrefix(), $mysql['data'], $mysql['description']);
$this->_db->query($sql);
$lastInsertId = $this->_db->insert_id;
$this->_db->close();
Expand Down Expand Up @@ -82,7 +82,7 @@ public function get($id)
$clean['id'] = (int)$id;
$mysql['id'] = $this->_db->real_escape_string($clean['id']);

$sql=sprintf("SELECT block, description FROM `%sblocks` WHERE id = %s", Database::getTablePrefix(), $mysql['id']);
$sql=sprintf("SELECT block, description FROM `%sblocks` WHERE id = '%s'", Database::getTablePrefix(), $mysql['id']);
$query = $this->_db->query($sql);
$content = '';

Expand Down Expand Up @@ -127,7 +127,7 @@ public function getUnwrapped($id)
$clean['id'] = (int)$id;
$mysql['id'] = $this->_db->real_escape_string($clean['id']);

$sql=sprintf("SELECT block FROM `%sblocks` WHERE id = %s", Database::getTablePrefix(), $mysql['id']);
$sql=sprintf("SELECT block FROM `%sblocks` WHERE id = '%s'", Database::getTablePrefix(), $mysql['id']);
$query = $this->_db->query($sql);

if($query->num_rows > 0) {
Expand Down Expand Up @@ -202,7 +202,7 @@ public function blockUpdate($id, $content, $description)
$mysql['content'] = $this->_db->real_escape_string($clean['content']);
$mysql['description'] = $this->_db->real_escape_string($clean['description']);

$sql=sprintf("UPDATE `%sblocks` SET block = '%s', description = '%s' WHERE id = %s", Database::getTablePrefix(), $mysql['content'], $mysql['description'], $mysql['id']);;
$sql=sprintf("UPDATE `%sblocks` SET block = '%s', description = '%s' WHERE id = '%s'", Database::getTablePrefix(), $mysql['content'], $mysql['description'], $mysql['id']);;
$this->_db->query($sql);
$this->_db->close();

Expand Down Expand Up @@ -237,7 +237,7 @@ public function blockUpdateAll($id, $content, $description)
$mysql['content'] = $this->_db->real_escape_string($clean['content']);
$mysql['description'] = $this->_db->real_escape_string($clean['description']);

$sql=sprintf("UPDATE `%sblocks` SET block = '%s', description = '%s' WHERE id = %s", Database::getTablePrefix(), $mysql['content'], $mysql['description'], $mysql['id']);
$sql=sprintf("UPDATE `%sblocks` SET block = '%s', description = '%s' WHERE id = '%s'", Database::getTablePrefix(), $mysql['content'], $mysql['description'], $mysql['id']);
$this->_db->query($sql);
$this->_db->close();

Expand All @@ -260,7 +260,7 @@ public function blockDelete($id)
$clean['id'] = (int)$id;
$mysql['id'] = $this->_db->real_escape_string($clean['id']);

$sql=sprintf("DELETE FROM `%sblocks` WHERE id = %s", Database::getTablePrefix(), $mysql['id']);
$sql=sprintf("DELETE FROM `%sblocks` WHERE id = '%s'", Database::getTablePrefix(), $mysql['id']);
$this->_db->query($sql);
$this->_db->close();

Expand Down

0 comments on commit 6ad47df

Please sign in to comment.