05-23-2009, 09:43 PM
|
#19 (permalink)
|
|
The Contributor
Join Date: May 2009
Posts: 53
Thanks: 2
|
As I'm currently learning about classes, it'd be super cool if someone had somne time on their hands to make my code to a class, and how to use that class so I get the same output!
I'm referring to this code..:
PHP Code:
<? $result = mysql_query("SELECT * FROM Portfolio"); function WhoAmIBoundTo($bound) { $res = mysql_query("SELECT * FROM Portfolio WHERE id = '$bound' ORDER BY id ASC LIMIT 0,1"); while($func = mysql_fetch_array($res)) { echo $func['id']; } } while ($row = mysql_fetch_array($result)) { if ($row['thumb'] == '1') { echo '<a rel="shadowbox['.$row['id'].'];" href="'.$row['thumbMax'].'" class="option thumb" title="'.$row['pictureDesc'].'"><img src="'.$row['picture'].'" class="thumbs" alt=""/></a> '; } else { echo '<a rel="shadowbox['; WhoAmIBoundTo("".$row['boundTo'].""); echo '];" href="'.$row['picture'].'" class="hidden" title="'.$row['pictureDesc'].'"></a>'; } } ?>
Last edited by Sirupsen : 05-24-2009 at 08:59 AM.
|
|
|