$result[] = mysqli_query($link,'select t1.tid,t1.title,t1.start_date,t1.starter_name,t2.post,t1.starter_id,"bignews" as array_name from '.$INFO['sql_tbl_prefix'].'topics t1 join '.$INFO['sql_tbl_prefix'].'posts t2 on (t1.tid = t2.topic_id) where t1.forum_id = 2 order by t1.start_date desc limit 1;');
$result[] = mysqli_query($link,'select t1.tid,t1.title,t1.start_date,t1.starter_name,t2.post,t1.starter_id,"news" as array_name from '.$INFO['sql_tbl_prefix'].'topics t1 join '.$INFO['sql_tbl_prefix'].'posts t2 on (t1.tid = t2.topic_id) where t1.forum_id = 44 order by t1.start_date desc limit 6;');
//echo mysqli_error($link);
foreach ($result as $result) {
$x = 0;
while ($r = mysqli_fetch_array($result, MYSQL_ASSOC)) {
$x++; foreach ($r as $key => $value) {
$r[$r['array_name'].$x.$key] = $r[$key];
unset($r[$key]);
}
$msg = array_merge($msg,$r);
}
}
Kāds būtu ātrākais veids ielādēt Mysql query php arry'ā? Pagaidām man sanācis uzkricelēt ko tādu. Ideja ir tādā, ka PHP izveido array ar unikāliem key'iem kurus vēlāk var ar str_replace samainīt teksta templaitā ar attiecīgajiem rezultātiem. Un iekašot, lai lietotājs ielādē pliku html.
tb {bignews1title} uz "Kaut kāds rezultāts"