Log in

View Full Version : how to write mysql right for this...



chrjoh88
12-06-2010, 03:04 PM
I want to get data from another db i have this sql

http://purge.mine.nu/mysqlhelp.html <= output of php file


The $row['class'] is in sed_users and what i know from befor i used the ft_id to get the data but i have forgotten how i did it :mad:

Thanks in advance.


$row['ft_lastposturl'] = ($usr['id']>0 && $row['ft_updated'] > $usr['lastvisit']) ?
"<a class=\"armory_tt_class_".$row['class']."\" href=\"forums.php?m=posts&amp;q=".$row['ft_id']."&amp;n=unread#unread\">".$row['ft_lastpostername']."</a>" :
"<a class=\"armory_tt_class_".$row['class']."\" href=\"forums.php?m=posts&amp;q=".$row['ft_id']."&amp;n=last#bottom\">".$row['ft_lastpostername']."</a>";

chrjoh88
12-08-2010, 12:16 AM
Atm im trying this code

$sql_class = sed_sql_query("SELECT c.*, u.class FROM sed_forum_topics AS c
LEFT JOIN sed_users AS u ON u.user_id=c.ft_lastposterid
WHERE ft_sectionid='$ft_id' ORDER BY ft_sectionid ASC");
$row_class = sed_sql_fetcharray($sql_class);

but ain't having that mutch of an luck atm.


Thanks in advance.