Omer
Mohsin
for Omer he designed a logo and for Mohsin he designed a web site
now in this case it is very simple and straight,but if both of these works means
logo designing and web site designing were done for the single customer say Omer then it should not show the name twice either means what if he has made the logo designing and web site for Omer only then omer should be visible only once.the atbles i am using are
category,client,portfolio
category holds the works for eg web page design,print media,logo designing e.t.c
client holds the names of the clients that he worked for
portfolio stores the client_id and category_id
the code that i have written is here
Expand|Select|Wrap|Line Numbers
- $q1 = "select DISTINCT client_id, Category_Id from portfolio order by EntryDate desc limit 6";
- $r1 = mysql_query($q1) or die(mysql_error());
- if(mysql_num_rows($r1)){
- while($f1 = mysql_fetch_array($r1)){
- $cat_id = $f1['Category_Id'];
- $client_id = $f1['client_id'];
- $q2 = "select * from client where client_id='$client_id' order by client_id desc";
- $r2 = mysql_query($q2) or die(mysql_error());
- if(mysql_num_rows($r2)){
- while($f2 = mysql_fetch_array($r2)){
- $c_name = $f2['client_name'];
- echo '<tr><td align="left" valign="top" class="text-color-deepyellow"><a href="portfolio.php?cat_id='.$cat_id.'&client_id='.$client_id.'" class="text-color-deepyellow_link">'.$c_name.'</a></td></tr>';
- }
- }
- }
- }
regards ,
Omer Aslam