/    Sign up×
Community /Pin to ProfileBookmark

why cant retreive ‘$value’ in this code?

[code]<?

if($row_Rs1!=”){
do{?>
<tr>
<td align=”left” class=”content”><? echo $row_Rs1[‘comname’];?></td>
<td class=”content”>
<?
$querycomprofile = “SELECT status FROM ykgoc_com_profile WHERE status=10 AND comid=”.$row_Rs1[‘comid’];
$findcp = mysql_query($querycomprofile, $pamconnection);
$rs_findcp = mysql_fetch_assoc($findcp);
if($rs_findcp[‘status’]==’10’){ echo “Have Profile”;}
else if($rs_findcp[‘status’]==’1′){ echo “Awaiting to publish”;}
else if($rs_findcp[‘status’]==’0′){ echo “Awaiting to approve”;}
else if($rs_findcp[‘status’]==”){ echo “<a href=’post_comprofile.php?id='”.$row_Rs1[“comid”].”‘>Set Profile</a>”;}
//else if($rs_findcp[‘status’]==”){ echo “<a href=’post_comprofile.php?id='”.$row_Rs1[‘comid’].”‘>Set Profile</a>”;} //’.$row_Rs1[‘comid’]
?>
</td>
<td class=”content”><a href=”detail_for_member.php?subscriber_id=<? echo $row_Rs1[‘comid’]; ?>” class=”style2″ target=”_blank”>Detail</a></td>
?>
</td> –>
</tr>
<tr><td colspan=”4″><hr><td></tr>
<? }while($row_Rs1=mysql_fetch_assoc($Rs1));
}?>
[/code]

Can anybody tell me what’s wrong in this code? why I can’t get the value of $row_Rs1[‘comid’] in this:
echo “<a href=’post_comprofile.php?id='”.$row_Rs1[‘comid’].”‘>Set Profile</a>”;}
but can get the value in this:
<a href=”detail_for_member.php?subscriber_id=<? echo $row_Rs1[‘comid’]; ?>” class=”style2″ target=”_blank”>Detail</a>

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogJul 14.2007 — Looks like you have an extra single-quote in there. I believe you want:
[code=php]
echo "<a href='post_comprofile.php?id=".$row_Rs1["comid"]."'>Set Profile</a>";
[/code]
Copy linkTweet thisAlerts:
@zhinigamiauthorJul 14.2007 — Thank you very much...

sigh~ I just made a stupid mistake and haven't realize it till you reply...

Gonna remember this as a lesson..

In any event, thanks again for the replied and correcting my fault.

Regards
×

Success!

Help @zhinigami spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...