Jump to content

xux

Members
  • Posts

    85
  • Joined

  • Last visited

    Never

Everything posted by xux

  1. Tdw,           I appreciate your effort.I am sort of confused too about the whole Issue Bcos It is Just the small part of a bigger Issue.Am working towards making an html newsletter.Can you give me insight into your database scheme?how many fields do you have?I will really appreciate.THanks Xux
  2. Hey to the gurus out there,help is still needed.
  3. tdw,     I appreciate your efforts.The only field in the table is email,so do you think I have to change the query?Thanks
  4. Hi,     It is outputting the header of the table but it is leaving out the cells.When I did what you recommended it outputted the number of rows with no error but did not output the content of the database.
  5. I have done that but it is still not displaying the content of the database.
  6. Hi,   Please I need help,am trying to display the content of a database via  php (as a web interface),it is not reporting any error but it is not displaying the contrnts the codes are below [code] <?php include('header1.tpl'); // connecting to MySQL server $connection = mysql_connect('localhost', '', '') or die ('Unable to connect!'); // selecting database for use mysql_select_db('DB') or die ('Unable to select database!'); // create and execute query $query = 'SELECT email FROM table'; $result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error()); // check if records were returned if (mysql_num_rows($result) > 0) { // print HTML table echo'<br/>'; echo '<table width=80% cellpadding=10 cellspacing=0 border=1 align=center>'; echo '<tr><td><b><center>Email Address of Subscribers</center></b></td></tr>'; echo '<ul>'; // iterate over record set // print each field while($row = mysql_fetch_object($result)) { // prints in format "email" echo '<tr>'; echo '<td>' . $row->email.'</td>'; echo '</tr>'; } echo '</table>'; } else { // print error message echo 'No rows found!'; } // once processing is complete // free result set mysql_free_result($result); // close connection to MySQL server mysql_close($connection); ?> </div> <?php [/code] Thanks in advance
  7. Hi,     I tested your code and it work perfectly alright,but it was send to the junk of my yahoo.On getting to my junk,i actually found out that the code i posted(the one I felt was not working) have been sending [code]header.tplfooter.tpl[/code] to the my email(I was using it to test the code),so i think I hve isolated the problems which I hope you will be kind enough to help me solve 1.The code has not been grabbing the header(an image),the content and the footer (which is an image too) 2.It has been echoing "Newsletter can not be sent" while it have been sending it Am sure you will be able to help me out on it. 3.Sending the newsletter to the emails stored in the database Thanks a lot,I appreciate your help. My Regards Dayo
  8. Hi,     I tested your code and it work perfectly alright,but it was send to the junk of my yahoo.On getting to my junk,i actually found out that the code i posted(the one I felt was not working) have been sending [code]header.tplfooter.tpl[/code] to the my email(I was using it to test the code),so i think I hve isolated the problems which I hope you will be kind enough to help me solve 1.The code has not been grabbing the header(an image),the content and the footer (which is an image too) 2.It has been echoing "Newsletter can not be sent" while it have been sending it Am sure you will be able to help me out on it. Thanks a lot,I appreciate your help. My Regards Dayo
  9. Hi,     After trying out the suggestion given to me,the script is still not working.It it a bit complicated because I want to send the newsletter in html format,it would have been easier in plain language but html is the required format.so please what help/suggestion are you going to give.Thanks
  10. Thanks,           Let me implement those changes.I will keep you inform.Thanks
  11. It was not copied from anywhere,I thought I had came up with a perfect code.It wasnt reporting any error but it just echoing "Newsletter cant be send".So it looks like a logical error.Thanks
  12. Hi,     I am trying to set up a newsletter script but it is saying cannot send newsletter.Please I need urgent help. here is the code Code: <?php     $message= "header.tpl".$contents."footer.tpl";   ?> <?php // connecting to MySQL server $connection = mysql_pconnect('localhost', '', '') or die ('Unable to connect!'); // selecting database for use mysql_select_db('db') or die ('Unable to select database!'); // create and execute query $query = 'SELECT email FROM newsletter'; $result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error()); // check if records were returned if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_array($result))   $toAddress=$result;   $subject=$header."\n";   //error suppressed,remove it to see what happens   @$success=mail($toAddress,$subject,$message); } if($success){ print "Newsletter Sent";             } else{       echo'Newwsletter could not be sent';   }    // once processing is complete // free result set mysql_free_result($result);             ?> Please I will appreciate your help. Thanks
  13. Hi,   I have made those changes and it is still reporting Newsletter could not be sent.
  14. Hi,     I am trying to set up a newsletter script but it is saying cannot send newsletter.Please I need urgent help. here is the code [code] <?php     $message= "header.tpl".$contents."footer.tpl";   ?> <?php // connecting to MySQL server $connection = mysql_pconnect('localhost', '', '') or die ('Unable to connect!'); // selecting database for use mysql_select_db('db') or die ('Unable to select database!'); // create and execute query $query = 'SELECT email FROM newsletter'; $result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error()); // check if records were returned if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_array($result))   $toAddress=$result;   $subject=$header."\n";   //error suppressed,remove it to see what happens   @$success=mail($toAddress,$subject,$message); } if($success){ print "Newsletter Sent";             } else{       echo'Newwsletter could not be sent';   }    // once processing is complete // free result set mysql_free_result($result);             ?> [/code] Please I will appreciate your help. Thanks
  15. Thanks,           but how do I make sure that the quotes chanes everyday,as in replacing the quotes everyday?Thanks
  16. Thanks,           I have the various quotes stored in a database,i want to extract one per day to be displayed in a table as the quote of the day.
  17. Hi everyone,                 I am trying to implement changing quote on a site everyday using php.please i need help.Thanks
  18. Thanks for your time,let me try it out.C ya later ;D
  19. Thanks,           I tried that,but it is still reporting the same error.I will appreciate ur assistance.Thanks
  20. My code is working,but not perfect.it is inserting $content instead of the string collected from a form/here is my code [code] <?php     $content = $HTTP_POST_VARS['content'];   $content = addslashes($content);   // connecting to MySQL server $connection = mysql_pconnect('localhost', 'root', '') or die ('Unable to connect!'); // selecting database for use mysql_select_db('sme_cms') or die ('Unable to select database!'); // create and execute query $query = 'UPDATE news set news_content="$content"'; $result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error()); if($result){ print " Database Have Been Updated";             } else{       echo' Database Could Not Be Updated';   }                ?> [/code] Thanks for you help so far.
  21. ok, maybe i should remove that portion of the code.or what do you think?thanks
  22. Hi,   After effecting the changes you suggested it is still outputing 'could not log in' despite using the right name and password.what do you think i can do,or is there another way to implement it? i see that you are a moderator,that shows you must be php guru,can you also help with an updating script into a mysql database using database?thanks
  23. Hi,   Thanks.I will try that out.But am using php4,can I used the new variable?I appreciate it,see ya later.
  24. YEs,i cant find the new data in the database,although it was reporting database updated.Thanks
  25. Hi Everybody,                 I have a problem updating my database from a web interface using php,no error was reported but the database is not being updated.the code are are below [code] <?php     $content = $HTTP_POST_VARS['content'];   $content = addslashes($content);   // connecting to MySQL server $connection = mysql_pconnect('localhost', 'rit', 'password') or die ('Unable to connect!'); // selecting database for use mysql_select_db('dbs') or die ('Unable to select database!'); // create and execute query $query = 'UPDATE news set news_content="$content"'; $result = mysql_query($query) or die ('Error in query: $query. ' . mysql_error()); if($result){ print " Database Have Been Updated";             } else{       echo' Database Could Not Be Updated';   }                ?> [/code] Your help will be appreciated.Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.