Closed (fixed)
Project:
Send
Version:
6.x-1.0-alpha4
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
20 Sep 2010 at 09:29 UTC
Updated:
28 Apr 2011 at 01:51 UTC
line 225 and 245 of send.api.inc has a problem, with using database prefix.
these must change from:
if ($table) {
if ($row = db_fetch_array(db_query("SELECT * FROM {$table}
WHERE scid = %d", $row->scid))) {
foreach ($row as $key => $val) $contact->key = $contact->val;
}
}
}
}
elseif ($table) {
// Search the table for a unique value.
$schema = drupal_get_schema($table);
$query = array();
if (isset($schema['unique keys'])) {
foreach ($schema['unique keys'] as $keys) {
foreach ($keys as $key) {
$place = db_type_placeholder($schema['fields'][$key]['type']);
$query[] = "$key = $place";
$values[] = $contact->$key;
}
}
if ($row = db_fetch_array(db_query("SELECT * FROM {$table}
to:
if ($table) {
if ($row = db_fetch_array(db_query('SELECT * FROM {'.$table.'}
WHERE scid = %d', $row->scid))) {
foreach ($row as $key => $val) $contact->key = $contact->val;
}
}
}
}
elseif ($table) {
// Search the table for a unique value.
$schema = drupal_get_schema($table);
$query = array();
if (isset($schema['unique keys'])) {
foreach ($schema['unique keys'] as $keys) {
foreach ($keys as $key) {
$place = db_type_placeholder($schema['fields'][$key]['type']);
$query[] = "$key = $place";
$values[] = $contact->$key;
}
}
if ($row = db_fetch_array(db_query('SELECT * FROM {'.$table.'}
WHERE '. join(' AND ', $query), $values))) {
Comments
Comment #1
allie mickaCommitted. Thanks so much esmailzadeh!