Jump to content

trq

Staff Alumni
  • Posts

    30,999
  • Joined

  • Last visited

  • Days Won

    26

Everything posted by trq

  1. if ($result = mysql_query("SELECT email FROM users")) { if (mysql_num_rows($result)) { $users = array(); while ($row = mysql_fetch_assoc($result)) { $users[] = $row['email']; } } }
  2. Just bcc them in. A simple example. <?php // this would come from your database. $users = array('[email protected]','[email protected]','[email protected]'); $to = '[email protected]'; $subject = 'subject'; $message = 'this is an example'; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'Bcc: ' . implode(', ', $users) . "\r\n"; 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> This will send the email to you, but bcc in all your users from your database.
  3. No, http is the webs protocol, not part of a domain name. www is generally a subdomain on that server specifically used for serving web content. Your hostname entry should look more like..... $dbhost = "mydatabase.com"; Be aware though that using a hostname is going to be slower than an ip. If you know the domain you can find the ip easily enough by pinging it (I don't/won't use Cpanel).
  4. trq

    Jail a user?

    Do what?
  5. Yes, you need to replace the localhost domain with either the ip address or domain name of your mysql server database.
  6. Thats helpful. Try debugging it. if ($result = mysql_query("SELECT COUNT(id) AS cnt FROM inbox WHERE read = '0'")) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo $row['cnt']; } else { // no records found. } } else { trigger_error(mysql_error()); }
  7. Just gotta remember that arrays start at 0. So if you have an array with 10 indexes within it, the highest index number will be 9 not 10.
  8. trq

    MySql Triggers

    What is the exact error and code?
  9. I don't see any issue. What exactly is the problem? Just make sure your development environment as closely as possible mirrors your production environment and there won't be any issues.
  10. This topic has been moved to PHP Coding Help. http://www.phpfreaks.com/forums/index.php?topic=308068.0
  11. You woulds be much better off using the api that youtube provide. http://code.google.com/apis/youtube/overview.html
  12. Your while goes one increment too many. Should be..... while( $counter < count($_FILES['photo_filename']['tmp_name']))
  13. So many things wrong with this code. Firstly, executing mysql_query() within mysql_num_rows() like that is ridiculous. it gives you absolutely no opportunity to check your query for success before attempting to use its result. Speaking of which, your query is failing because its syntax is incorrect. You might try..... SELECT id FROM inbox WHERE read = '0' So, that would be.... if ($result = mysql_query("SELECT id FROM inbox WHERE read = '0'")) { echo mysql_num_rows($result); } Now, considering you only want a count and not the actual data, this would be even better. if ($result = mysql_query("SELECT COUNT(id) AS cnt FROM inbox WHERE read = '0'")) { if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); echo $row['cnt']; } }
  14. Also, why does Email extend Database? The two seem unrelated and your passing a Database object into Email anyway?
  15. The error is pretty self explanitory. NumRows is not a property of your $q object (whatever that is). What is returned by db->select() ? That is the object we need to see.
  16. Locked. There isn't a specific question, your asking for opinion. obviously know one has anything nice to say.
  17. trq

    Jail a user?

    I thought you said in your first post that this wasn't an option. So, in my very first reply I gave you an alternative.
  18. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=308032.0
  19. One has more verbose error reporting is all. Neither would work, but only one seems to be displaying the warning.
  20. foreach ($_GET as $k => $v) { echo "$k = $v<br />"; }
  21. All of this information would have been help full when you first asked your question. Indeed it does. If you want /etc/ to be persistent your going to need persistent storage. Generally though, the /etc directory needs to be on the root partition because the fstab file is read from there at boot time. You could try mounting /etc to a persistent drive late in the boot process maybe, I can see this getting pretty tricky.
  22. Is this system running from cd or some other unusual medium? You don't have any normal file systems mounted.
  23. trq

    Cron problem

    Its not Cron that is creating the file, but the command you are telling Cron to execute. Is there a particular reason you are making a http request for the php file instead of executing it via the cli?
  24. WTF? I asked for the output of.... cat /etc/fstab Nothing to do with your Samba config. As for what 'distro' means. Its what GNU/Linux 'type' youi are using. eg, Debian, Ubuntu, CentOS etc etc. I saw in another of your threads your using CentOS so, I assume this problem relates to the same machine? Your distro is CentOS then.
×
×
  • 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.