Jump to content
Sign in to follow this  
masrawy

Problem Of Sending Email To User

Recommended Posts

sir i need it to print in this table<table border="0" width="100%" bordercolor="#FFFFFF" cellpadding="2" height="71"><tr><td width="26%" height="15" bgcolor=#efe8d6><b><span lang="ar-eg">اسم المستخدم</span></b></td><td width="85%" height="15" align="right" bgcolor="#efe8d6"><? echo " {$row['name']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">تاريخ العضوية</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['date']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الإعلانات</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['countt']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المتجر الإلكتروني</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['m_name']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المنتدى الإلكتروني</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['ccoounttt']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b>البريد الإليكتروني</b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['email']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الدولة</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['country']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المدينة</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['city']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الجوال</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['mobile1']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الهاتف</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['tel']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">طرق اتصال أخرى</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? $another_ways=nl2br($another_ways);?> <? echo "{$row['another_ways']}" ?></td></tr>i put this table in file and i pute it as inclode fie after searsh code

Share this post


Link to post
Share on other sites

sir i need it to print in this table<table border="0" width="100%" bordercolor="#FFFFFF" cellpadding="2" height="71"><tr><td width="26%" height="15" bgcolor=#efe8d6><b><span lang="ar-eg">اسم المستخدم</span></b></td><td width="85%" height="15" align="right" bgcolor="#efe8d6"><? echo " {$row['name']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">تاريخ العضوية</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['date']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الإعلانات</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['countt']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المتجر الإلكتروني</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['m_name']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المنتدى الإلكتروني</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['ccoounttt']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b>البريد الإليكتروني</b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['email']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الدولة</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['country']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المدينة</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['city']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الجوال</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['mobile1']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الهاتف</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['tel']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">طرق اتصال أخرى</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? $another_ways=nl2br($another_ways);?> <? echo "{$row['another_ways']}" ?></td></tr>i put this table in file and i pute it as inclode fie after searsh code

Share this post


Link to post
Share on other sites

sir i need it to print in this table<table border="0" width="100%" bordercolor="#FFFFFF" cellpadding="2" height="71"><tr><td width="26%" height="15" bgcolor=#efe8d6><b><span lang="ar-eg">اسم المستخدم</span></b></td><td width="85%" height="15" align="right" bgcolor="#efe8d6"><? echo " {$row['name']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">تاريخ العضوية</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['date']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الإعلانات</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['countt']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المتجر الإلكتروني</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['m_name']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المنتدى الإلكتروني</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['ccoounttt']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b>البريد الإليكتروني</b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['email']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الدولة</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['country']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المدينة</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['city']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الجوال</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['mobile1']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الهاتف</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['tel']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">طرق اتصال أخرى</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? $another_ways=nl2br($another_ways);?> <? echo "{$row['another_ways']}" ?></td></tr>i put this table in file and i pute it as inclode fie after searsh code

Share this post


Link to post
Share on other sites

Just replace the table in the loop with those rows.

  while ($row = mysql_fetch_assoc($result))  {	?><tr><td width="26%" height="15" bgcolor=#efe8d6><b><span lang="ar-eg">اسم المستخدم</span></b></td><td width="85%" height="15" align="right" bgcolor="#efe8d6"><? echo " {$row['name']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">تاريخ العضوية</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['date']}" ?></td></tr>...	<?php  }

Share this post


Link to post
Share on other sites

Just add another row in the table. If the $row variable from the database contains those fields then just change the name to print.

Share this post


Link to post
Share on other sites

i did sir see $row['ccoounttt']but all the fileds work but ther is 3 not work <tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">الإعلانات</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['countt']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المتجر الإلكتروني</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo " {$row['m_name']}" ?></td></tr><tr><td width="26%" height="19" bgcolor=#efe8d6><b><span lang="ar-eg">المنتدى الإلكتروني</span></b></td><td width="85%" height="19" align="right" bgcolor="#efe8d6"><? echo "{$row['ccoounttt']}" ?></td></tr>i need tis thre works if i sersh for membersee whene i see an article for any user i can see this table under his artile i need also if i shearsh for member see also this table contain his information

Share this post


Link to post
Share on other sites

All of the fields are coming from the same place in the database. If you don't see anything in the 'm_name' or 'countt' fields, then the database does not have any data in those fields.

Share this post


Link to post
Share on other sites

no sir i see it under att documents by any user the information like that in tablesee thatif ($action == "u_mtajer") {br(); echo "<center><font size=4 face=\"Traditional Arabic\"><b>المتجر الإلكتروني</b></font></center>";br(); br();if($memberid == ""){ echo "<p align=right><b><font size=2 color=#FF0000>عفواً.. لم تقم بالدخول للموقع، ولذلك لا يمكننا معرفة ما هو رابط متجرك الإلكتروني. يرجى <a href=index.php?action=inside><b><font size=2>الدخول للموقع </font></b></a> عن طريق اسم المستخدم وكلمة السر، أو كتابة رابط متجرك الإلكتروني في المتصفح مباشرة.</font></b></p>";br();}else {$selecct= mysql_query ("SELECT * from mtajer where mem_id='$memberid' and active='1'");$count= mysql_num_rows($selecct);if ($count == ""){ echo "<p align=right><b><font size=2 color=#FF0000>عفواً.. لم تقم بتصميم متجرك الإلكتروني. يمكنك تصميمه الآن عن طريق خطوات سهلة وواضحة في صفحة <a href=index.php?action=add_mtjer><b><font size=2>تصميم متجرك الإلكتروني </font></b></a> .</font></b></p>";}if ($count != ""){br(); $as2_select = mysql_query ("SELECT * from mtajer where mem_id='$mem_id' and active='1'"); while ($Row4=mysql_fetch_array($as2_select)) { $m_id = $Row4 [id]; $mem_id = $Row4 [mem_id]; $m_name = $Row4 [m_name]; $m_photo = $Row4 [m_photo]; $m_email = $Row4 ; $m_disc = $Row4 [m_disc]; $as7_select = mysql_query ("SELECT * from members where id='$mem_id' and active='1'"); while ($Row=mysql_fetch_array($as7_select)) { $id = $Row [id]; $mem_name = $Row [name]; $country = $Row [country]; $city = $Row [city]; $email = $Row ; $address = $Row [address]; $mobile = $Row [mobile1]; $tel = $Row [tel]; $another_ways = $Row [another_ways]; $date = $Row [date]; $special = $Row [special]; } $selecctm= mysql_query ("SELECT * from mtajer where mem_id='$mem_id' and active='1'"); $countm= mysql_num_rows($selecctm); $seleccts= mysql_query ("SELECT * from ssubject where mem_id='$mem_id' and active='1'"); $counts= mysql_num_rows($seleccts); $selecct= mysql_query ("SELECT * from forum_subjects where mem_id='$mem_id' and active='1'"); $countfs= mysql_num_rows($selecct); $selecctt= mysql_query ("SELECT * from forums where mem_id='$mem_id' and active='1'"); $countf= mysql_num_rows($selecctt); $selecctt= mysql_query ("SELECT * from subject_replays where subject_id='$m_id' and active='1'"); $countrep= mysql_num_rows($selecctt); $as2d_select = mysql_query ("SELECT * from ssubject where id='$m_id' and active='1'"); while ($Row9=mysql_fetch_array($as2d_select)) { $subjectid = $Row9 [id]; } $ascat_select = mysql_query ("SELECT * from cats where id='$cat_id' and active='1'"); while ($Row3=mysql_fetch_array($ascat_select)) { $catname = $Row3 [cat_name]; } $as17_select = mysql_query ("SELECT * from country where id='$sscountry'"); while ($Roww=mysql_fetch_array($as17_select)) { $scountry = $Roww [country]; }include ("template/style1/mtajer_disc.htm");br();echo "<table width=100% bgcolor=#1875B5><tr><td align=center> <b><font color=#FFFFFF>المعلن</font></b> </td></tr></table>";include ("template/style1/member_form_mtajer.tpl"); }br();}}}this is for the user mtjer i need like that when i searsh it print his mtjer and his subjects and his forumi hop you understand me

Share this post


Link to post
Share on other sites

Well, I don't really understand. It would seem like I would almost need all of the code to figure out how your site works, and I don't really want to wade through that much code. I'm not sure what that code you posted is doing, and it doesn't really help that they use variable names like $as2_select and $as7_select and $Row4 and things that don't really mean anything to me. The code isn't written very well, and combine that with the fact that it uses Smarty, which I haven't used, it doesn't make it very easy to understand, especially considering the language barrier. I wish I could be more help, but I think we're having problems understanding each other.

Share this post


Link to post
Share on other sites

i'm i;m soory sir for that what i need now isif i searsh for user print him information ther is subject table and every user have his owen subjecti need if i searsh with your code to user searsh print also his own subject and mtjer and forum and so on i hop you understand me

Share this post


Link to post
Share on other sites

No, I don't understand. I understand that you want to search for a user, that's fine. I don't know what a mtjer is, and I'm not sure how a user has subjects and forums, but I assume you have other database tables that have some other information you want to print also.The problem is how your site is set up. It sounds like there are a lot of files involved, and it's not very easy for me to tell you how to do something like this when you're working with the templates and includes and things like that, I just don't know how your site is put together. I showed you how to search for a user and print that stuff out in a table, but I can't say how to print subjects and forums, I just don't know the structure of the data you have.Basically, once you search for the user and have their ID, you should be able to look up whatever other information in the database using that ID. You print the other information the same way as I already showed you. First you get the results from the database and start your table, then you loop through each row and print it out.e.g.:

// get the data$result = mysql_query('SELECT * FROM subjects WHERE user=' . $user_id);// start the tableecho '<table>';// print each rowwhile ($row = mysql_fetch_assoc($result)){  echo '<tr>';  echo '<td>' . $row['data'] . '</td>'; // use whatever names you want to print in the row  echo '</tr>';}// end the tableecho '</table>';

Share this post


Link to post
Share on other sites

I will explan with tablesi have 3 table now1-mtajerthe table is idmem_idm_namem_photoemailm_discactive2- forumsthe tables is idmem_idf_namef_bannerf_emailf_discbasic_colorborder_coloractive3-ssubjectidcat_idmem_idscountryoffer_requests_names_photos_discu see sirmem_id is the same table now what i ineed if i searsh for member and what is the way to get his information if i searsh for member how can i get his information frome mtjer like m_name or any other field i know i make you tired but really i teash all i know frome you thank you really sir

Share this post


Link to post
Share on other sites

So you have code like this to do the search and print everything in the table:

if ($search_user != ''){  $result = mysql_query ("SELECT * from members where name LIKE '%" . mysql_real_escape_string($search_user) . "%' and active='1'");  while ($row = mysql_fetch_assoc($result))  {	// print the table  }}

I'm assuming that the members table also has a mem_id field. I'll give you an example with the mtjer table, it will work the same with the other 2 tables. There are a couple ways to do this, but a join might be too confusing to explain. This way should make more sense:

if ($search_user != ''){  $result = mysql_query ("SELECT * from members where name LIKE '%" . mysql_real_escape_string($search_user) . "%' and active='1'");  while ($row = mysql_fetch_assoc($result))  {	// print the table	// get mtjer results	$mem_id = $row['mem_id']; // if the members table does not have a "mem_id" field, change the name in the row	$mtjer_result = mysql_query('SELECT * FROM mtjer WHERE mem_id=' . $mem_id);	while ($mtjer_row = mysql_fetch_assoc($mtjer_result))	{	  echo $mtjer_row['m_name']; // print something from mtjer table	}  }}

That's the basic idea. You can add more code where it prints out the mtjer results so that it prints in table rows or however else you want it to print, but that's the idea. You can copy and paste the mtjer code to use with the other 2 tables also.

Share this post


Link to post
Share on other sites

i'm soory for that this is the come if ($search_user != ''){ $result = mysql_query ("SELECT * from members where name LIKE '%" . mysql_real_escape_string($search_user) . "%' and active='1'"); while ($row = mysql_fetch_assoc($result)) { // print the table // get mtjer results $mem_id = $row['name']; // if the members table does not have a "mem_id" field, change the name in the row $mtjer_result = mysql_query('SELECT * FROM mtjer WHERE mem_id=' . $mem_id); while ($mtjer_row = mysql_fetch_assoc($mtjer_result)) { echo $mtjer_row['m_name']; // print something from mtjer table } include ("template/style1/member_s.tpl"); }}give me this errorWarning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\7raj\index.php on line 4522this is members tableidnamecountrycitydaymonthbirthemailemail_casemobile1telanother_wayspasswordfullnamevveducationdatespecialactiveactive_code

Share this post


Link to post
Share on other sites

Just change this line to use id:$mem_id = $row['name']; // if the members table does not have a "mem_id" field, change the name in the rowThat's the only thing that needs to be changed, change 'name' to 'id'.

Share this post


Link to post
Share on other sites

If all you need is the number of records, you can replace this:

$mem_id = $row['id']; // if the members table does not have a "mem_id" field, change the name in the row$mtjer_result = mysql_query('SELECT * FROM mtjer WHERE mem_id=' . $mem_id);while ($mtjer_row = mysql_fetch_assoc($mtjer_result)){  echo $mtjer_row['m_name']; // print something from mtjer table}

with this:

$mem_id = $row['id'];$mtjer_result = mysql_query('SELECT * FROM mtjer WHERE mem_id=' . $mem_id);$num_mtjer = mysql_num_rows($mtjer_result);

or this:

$mem_id = $row['id'];$mtjer_result = mysql_query('SELECT COUNT(*) AS num FROM mtjer WHERE mem_id=' . $mem_id);$num_row = mysql_fetch_assoc($mtjer_result);$num_mtjer = $num_row['num'];

$num_mtjer will be the number of rows that the SQL statement returned.

Share this post


Link to post
Share on other sites

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\7raj\index.php on line 4521and what is will be the code echo to echo the results

Share this post


Link to post
Share on other sites

Change this:$mtjer_result = mysql_query('SELECT COUNT(*) AS num FROM mtjer WHERE mem_id=' . $mem_id);to this:$mtjer_result = mysql_query('SELECT COUNT(*) AS num FROM mtjer WHERE mem_id=' . $mem_id) or exit(mysql_error());

Share this post


Link to post
Share on other sites

thank you i did that another help plzther is two wayes if the user add advwant pay and celli put this code to print in index.phpthe last 5 want and the last 5 cellfun_block_open("345","100%","#e8d68e","#DD9900","<b><font size=2 color=#0000gg>".$Msg['hgi_lastsub']."</font></b>"); $as1_select = mysql_query ("SELECT * from ssubject where offer_request=1 order by id desc limit 0,5 "); while ($Row=mysql_fetch_array($as1_select)) { $ss_id = $Row [id]; $ss_name = $Row [s_name]; echo "<p style=\"padding-top: 2px;\">•<a href=\"index.php?action=advs&advid=$ss_id\"><font size=2><b>$ss_name </font></b></a></p>"; } fun_block_close();br(); //---------------------------------------------------------- اخر المعروضfun_block_open("345","100%","#e8d68e","#DD9900","<b><font size=2 color=#0000gg>".$Msg['hgi_lastsubb']."</font></b>"); $as1_select = mysql_query ("SELECT * from ssubject where offer_request=0 order by id desc limit 0,15 "); while ($Row=mysql_fetch_array($as1_select)) { $ss_id = $Row [id]; $ss_name = $Row [s_name]; echo "<p style=\"padding-top: 2px;\">•<a href=\"index.php?action=advs&advid=$ss_id\"><font size=2><b>$ss_name </font></b></a></p>"; } fun_block_close();br(); offer_request=pay or cellthe results fun_block_open("345","100%","#e8d68e","#DD9900","<b><font size=2 color=#0000gg>".$Msg['hgi_lastsub']."</font></b>"); $as1_select = mysql_query ("SELECT * from ssubject where offer_request=1 order by id desc limit 0,5 "); while ($Row=mysql_fetch_array($as1_select)) { $ss_id = $Row [id]; $ss_name = $Row [s_name]; echo "<p style=\"padding-top: 2px;\">•<a href=\"index.php?action=advs&advid=$ss_id\"><font size=2><b>$ss_name </font></b></a></p>"; } fun_block_close();br(); works good and print the last 5 but the code fun_block_open("345","100%","#e8d68e","#DD9900","<b><font size=2 color=#0000gg>".$Msg['hgi_lastsubb']."</font></b>"); $as1_select = mysql_query ("SELECT * from ssubject where offer_request=0 order by id desc limit 0,15 "); while ($Row=mysql_fetch_array($as1_select)) { $ss_id = $Row [id]; $ss_name = $Row [s_name]; echo "<p style=\"padding-top: 2px;\">•<a href=\"index.php?action=advs&advid=$ss_id\"><font size=2><b>$ss_name </font></b></a></p>"; } fun_block_close();br(); print onlly one resultswhere is the rong now i need to peint the last 5 adv from ssubject where offer_request=0and ssubject where offer_request=1

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...