voicemail_id is not guaranteed to be numeric so can't use the cast unless we protect against non numeric ids.
This commit is contained in:
parent
3758d84216
commit
2fd1a44842
|
|
@ -116,10 +116,10 @@ else {
|
|||
//get the list
|
||||
$sql = str_replace('count(*) as num_rows', '*', $sql);
|
||||
if (strlen($order_by) > 0) {
|
||||
$sql .= ($order_by == 'voicemail_id') ? "order by cast(voicemail_id as int) ".$order." " : "order by ".$order_by." ".$order." ";
|
||||
$sql .= ($order_by == 'voicemail_id') ? "order by voicemail_id ".$order." " : "order by ".$order_by." ".$order." ";
|
||||
}
|
||||
else {
|
||||
$sql .= "order by cast(voicemail_id as int) asc ";
|
||||
$sql .= "order by voicemail_id asc ";
|
||||
}
|
||||
$sql .= "limit ".$rows_per_page." offset ".$offset." ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
|
|
|
|||
Loading…
Reference in New Issue