Jump to content
Sign in to follow this  
masrawy

Problem Of Sending Email To User

Recommended Posts

OK, so does that tell you what the problem is? It says the column count doesn't match the value count.

Share this post


Link to post
Share on other sites

Think about what the error message means, this is a database error that says the column count is wrong. What does that sound like?

Share this post


Link to post
Share on other sites

By "column count", they mean the number of columns. The error means that the insert statement does not have the same number of columns as the table.

Share this post


Link to post
Share on other sites

VALUES ('','$id','$name','$receiver','$titlee','$mbody','$today_date','$ad','0','1','1')");Table structure for table hendawy_mailField Type Null Defaultid int(10) Yes NULLmem_id int(10) Yes 0sender varchar(100) Yes NULLreceiver varchar(100) Yes NULLtitle varchar(100) Yes NULLbody mediumtext Yes NULLdate varchar(100) Yes NULLtime time Yes 00:00:00eread enum('0', '1') Yes 0mshowi enum('0', '1') Yes 1mshowo enum('0', '1') Yes 1subject varchar(100) Yes NULLactivate varchar(100) Yes NULLmessage varchar(100) Yes NULL

Share this post


Link to post
Share on other sites

subject varchar(100) Yes NULLactivate varchar(100) Yes NULLmessage varchar(100) Yes NULL this i add so send email but ididn't find time time Yes 00:00:00

Share this post


Link to post
Share on other sites

There are 2 ways to do an INSERT. You can either list the columns, or not. If you don't list the columns then you have to give a value for every column in the table. That's what your queries are doing, they aren't listing the columns, only the values. If you don't want to give a value for every column, then you need to list which columns you're inserting. The columns and the values need to be in the same order. e.g.:$INSERTVALUES = mysql_query("INSERT INTO hendawy_mail (mem_id, sender, receiver, ...)VALUES ('$id','$name','$receiver','$titlee','$mbody','$today_date','$ad','0','1','1')");

Share this post


Link to post
Share on other sites

thank you sir i did it and i fix itanother helpthis code for delet replay frome replayed table <? $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)) { $speciall = $Row16 [special]; } }if ($special == "1" AND $mem_id == $memberid){?> <tr> <td colspan="2" bgcolor="#efe8d6"> <p align="center"> <a href="index.php?action=delete_subject&rep_id=<? echo $repid; ?>&subjectid=<? echo $subjectid; ?>" ><span lang="ar-eg">حـــذف</span></a></td> </tr><? } else {}?> this special member can delet his repllay and also delet member's repllays on his adv and also the member can delet only his reply it this code wright ?becouse it is not work

Share this post


Link to post
Share on other sites

now i have 2 kind of members1- member 2- special memberspecial member can delet his repllay and other members replaies on only his advbut member can only delet his repllayplz corect the code to do that

Share this post


Link to post
Share on other sites

All the code above does is print the delete links. If all you want to do is print the link for special members, wouldn't you just add an OR here to check if special is 2:if ($special == "1" AND $mem_id == $memberid){Or maybe you could just change that AND to an OR.

Share this post


Link to post
Share on other sites

if i change AND to an OR. that will make special member delet his repllay and other members replaies in his subjects ??and also any member can delet his replayes ?

Share this post


Link to post
Share on other sites

It will do exactly what the if statement says:if ($special == "1" OR $mem_id == $memberid){If $special is 1, or if the member ID matches, then they can see the delete link.

Share this post


Link to post
Share on other sites

this is delet code if ($action == "delete_subject") { $delete=mysql_query("DELETE from subject_replays WHERE id='$rep_id'"); if($delete){echo "تم الحذف بنجاح";} else {echo "هناك خطأ في عملية الحذف";}echo "<meta http-equiv=\"refresh\" content=\"2; URL=index.php?action=subject_disc&subjectid=$subjectid\">";}i need to the special only can delet his replay and other members replaybut member can only delet his replay not members replayes in his subject

Share this post


Link to post
Share on other sites

That code isn't checking any member IDs or anything, it's just checking if $action is "delete_subject". Is there code that checks the ID?

Share this post


Link to post
Share on other sites

Then according to what I see from the code, if the delete link is there it should delete, the code there is only checking if the delete link was there.

Share this post


Link to post
Share on other sites

this is the code of delet if ($action == "delete_subject") {$delete=mysql_query("DELETE from subject_replays WHERE id='$rep_id'");if($delete){echo "تم الحذف بنجاح";} else {echo "هناك خطأ في عملية الحذف";}echo "<meta http-equiv=\"refresh\" content=\"2; URL=index.php?action=subject_disc&subjectid=$subjectid\">";}so i need you to corect it sir

Share this post


Link to post
Share on other sites

You said it's not deleting when you click the link, right? The code you posted is saying to print a link like this:<a href="index.php?action=delete_subject&rep_id=...And the code to delete checks that:if ($action == "delete_subject") {...So according to the code, all you need in order to delete something is action=delete_subject on the link. If it's not deleting, the reason is in some other code that you haven't posted.

Share this post


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...
Sign in to follow this  

×
×
  • Create New...