Jump to content

Problem Of Sending Email To User


Recommended Posts

Does $sid actually hold the ID of the item you want to delete? You're telling the database to delete whatever matches $sid:$delete=mysql_query("DELETE from subject_replays WHERE id='$sid'");So you need to figure out if $sid contains the ID that you're actually trying to delete.

Link to post
Share on other sites
  • Replies 304
  • Created
  • Last Reply

Top Posters In This Topic

do the code like that hi sirthis code you write it for delet subject beforei put it to delet replayif ($action == "delete_replly") {br(); br();echo "<center><font size=4 face=\"Traditional Arabic\"><b> حزف الرد </b></font></center>";br(); br();echo "<p align=right><font size=2 color=#FF0000><b>   </b></font></p>";$result = mysql_query("SELECT mem_id FROM subject_replays WHERE id='{$repid}'");if ($row = mysql_fetch_assoc($result)){if ($row['mem_id'] == $memberid){$delete=mysql_query("DELETE from subject_replays WHERE id='$repid'");if($delete){echo "تم الحذف بنجاح";} else {echo "ليس لديك صلاحية هذا هذا الاعلان";}}else{echo "ليس لديك صلاحية لحزف الرد";}}else{echo "هذا الاعلان غير موجود ";}echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php\">";}

Link to post
Share on other sites

What do you need help with? Is it deleting? Does $repid contain the ID you're trying to delete? Have you printed $repid or the query to check on them? We keep going over the same things. If it's not working, print everything out and figure out why it's not working. You don't need to wait for me to tell you that.

Link to post
Share on other sites

i found this sirif ($memberid ==""){}else {br();echo "<table width=95% bgcolor=$col2 height=25><tr><td align=center> <b><font color=#FFFFFF>الردود: $countrep</font></b> </td></tr></table>";br(); $asmemr_select = mysql_query ("SELECT * from subject_replays where subject_id='$advid' and active='1' order by id desc");$i=1;while($row55=mysql_fetch_array($asmemr_select)){ $repid = "$i"; $member_id = $row55[mem_id]; $replay = $row55[replay]; $date = $row55[date];$i++; $asmem_select = mysql_query ("SELECT * from members where id='$member_id' and active='1'"); while ($Row6=mysql_fetch_array($asmem_select)) { $name = $Row6 [name]; $country = $Row6 [country]; $email = $Row6 ;include ("template/style1/replay_form.tpl");} } if($rep == "1"){br(); br();echo "<table width=95% bgcolor=$col2><tr><td align=center> <b><font color=#FFFFFF>إضافة رد</font></b> </td></tr></table>";br();

Link to post
Share on other sites

Listen, I'm not going to keep writing code for you. We're 250 posts into this topic, and you should know how to do it by now. This is your delete code:

$result = mysql_query("SELECT mem_id FROM subject_replays WHERE id='{$repid}'");if ($row = mysql_fetch_assoc($result)){  if ($row['mem_id'] == $memberid)  {	$delete=mysql_query("DELETE from subject_replays WHERE id='$repid'");	if($delete){echo "تم الحذف بنجاح";} else {echo "ليس لديك صلاحية هذا هذا الاعلان";}  }  else  {	echo "ليس لديك صلاحية لحزف الرد";  }}else{  echo "هذا الاعلان غير موجود ";}

You should be able to debug that by adding statements to tell you what it's doing. It only deletes if $row['mem_id'] equals $memberid, so put some echo statements there so that you can tell if those two are equal. If they are equal, then it runs a delete query. Print the delete query out to see what it looks like, and run it on the database yourself to see if it deletes the record you're trying to delete.I can't do all of this for you. I don't have the time to do my job and your job, I only have the time to do my job. You need to learn how to do your job, no one else can do it for you.

Link to post
Share on other sites

<br><a href="index.php?action=delete_subject&rep_id=<? echo $repid; ?>&subjectid=<? echo $subjectid; ?>" ><span lang="ar-eg">حـــذف</span></a></td></tr>i main this code not delet the code you write i know becouse you write one like it beforei need the code if i puch go to the code you writelike that but for replay<br><a href="index.php?action=delete_subject&rep_id=<? echo $repid; ?>&subjectid=<? echo $subjectid; ?>" ><span lang="ar-eg">حـــذف</span></a></td></tr>

Link to post
Share on other sites

The code there doesn't do the delete, it only prints the delete link. Make sure it's printing the right IDs into the link, and that it uses the right action, and add debugging code into the code for that action to print the IDs and make sure they came through right.

Link to post
Share on other sites

this is the code<br><a href="index.php?action=delete_subject&rep_id=<? echo $repid; ?>&subjectid=<? echo $subjectid; ?>" ><span lang="ar-eg">حـــذف</span></a></td>the id rightlook sirther is many subjectsevery subject have many reppliesi need now if i need to delet the repllay 1 frome the subject 100i go to the repplay and puch delet so it must be deletedbut now no

Link to post
Share on other sites

OK, so when you look at the link to delete, does the link say that the rep_id is 1 and the subjectid is 100? In the code where $action == "delete_subject" (the link you show above has "delete_subject" as the action), is it getting the rep_id and the subjectid, and deleting the correct record in the database?

Link to post
Share on other sites

OK, so does the link say "delete_subject" or "delete_repllay" on it? The word is actually "reply", with 1 "l", and no "a", but however you want to spell it I guess, as long as it's consistent. But all of the code you're posting shows that the link says "delete_subject" on it, it looks like it's trying to delete a subject instead of a reply.The point I'm trying to make is that you need to figure out which code the link is telling the PHP page to run, and then look at that code and figure out if it's doing what you're trying to do.

Link to post
Share on other sites

if ($action == "delete_replly") {br(); br();echo "<center><font size=4 face=\"Traditional Arabic\"><b> حزف الرد </b></font></center>";br(); br();echo "<p align=right><font size=2 color=#FF0000><b>   </b></font></p>"; $result = mysql_query("SELECT mem_id FROM subject_replays WHERE id='{$repid}'");if ($row = mysql_fetch_assoc($result)){ if ($row['mem_id'] == $memberid) { $delete=mysql_query("DELETE from subject_replays WHERE id='$repid'"); if($delete){echo "تم الحذف بنجاح";} else {echo "ليس لديك صلاحية هذا هذا الاعلان";} } else { echo "ليس لديك صلاحية لحزف الرد"; }}else{ echo "هذا الاعلان غير موجود ";}echo "<meta http-equiv=\"refresh\" content=\"0; URL=index.php\">";}and this is the code for delet icone<? $asmemr1_select = mysql_query ("SELECT * from ssubject where id='$ssub_id' and active='1'"); while ($Row515=mysql_fetch_array($asmemr1_select)) { $memberr_id = $Row515[mem_id]; $asmm_select = mysql_query ("SELECT * from members where id='$member_id' and active='1'"); while ($Row16=mysql_fetch_array($asmm_select)) { $special = $Row16 [special]; } }if ($special == "1" AND $mem_id == $memberid){?> <tr> <td colspan="2" bgcolor="<? echo $col1; ?>"> <p align="center"> <br> <a href="index.php?action=delete_subject&rep_id=<? echo $repid; ?>&subjectid=<? echo $subjectid; ?>" ><span lang="ar-eg">حـــذف</span></a></td> </tr> <? } else {}?>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...