June 22, 2014 - 10:21 22:21
Consulta sobre desarrollo
Datos importantes:
Url del foro: localhost
Version de SMF: 2.0.8
Theme del foro: Default
Descripcion del problema:
Buenas, resulta que estoy haciendo una modificación y creo yo que tengo todo bien aún así me salta este error:
The database value you're trying to insert does not exist: id_member
Log de errores:
The database value you're trying to insert does not exist: id_member
Function: scheduled_LoteryApply Filter: Only show the errors from this file File: C:/xampp/htdocs/dev/Sources/ScheduledTasks.php
Line: 1695
8: Undefined index: idApply Filter: Only show the errors from this file File: C:/xampp/htdocs/dev/Sources/ScheduledTasks.php
Line: 1673
El código que ocupo es el sgte:
function scheduled_Lotery()
{
global $smcFunc;
//Query min
$result_min = $smcFunc['db_query']('', "
SELECT min(id) FROM {db_prefix}shop_lotery",
array());
$array_min = $smcFunc['db_fetch_row']($result_min);
//Query max
$result_max = $smcFunc['db_query']('', "
SELECT max(id) FROM {db_prefix}shop_lotery
",
array());
$array_max = $smcFunc['db_fetch_row']($result_max);
$winner = rand($array_min['id'],$array_max['id']);
// Get stealee's (person we're stealing from) money count
$result_winner = $smcFunc['db_query']('', '
SELECT id, id_member
FROM {db_prefix}shop_lotery
WHERE id = {int:id}',
array(
'id' => $winner,
));
$array_winner = $smcFunc['db_fetch_row']($result_winner);
//Add Loteria
$smcFunc['db_insert']('insert', '{db_prefix}shop_lotery_winner',
array(
'id_member' => 'int',
),
array(
array(
'id_member' => $array_winner['id_member']
),
),
array());
return true;
}
?>
el function empieza desde la linea 1657, mi logica es una especie de loteria, escoger un numero al azar de la fila id de smf_shop_lotery y cuando se tenga el numero al azar, comparar con uno que tenga ese numero y de hay el resto me encargo yo, solo me salto eso y no entiendo el porque realmente da problema ¿alguna ayuda estimados?
Logged
Críticos hay muchos, quienes ayuden, pocos.