Jump to content

nfr

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nfr's Achievements

Member

Member (2/5)

0

Reputation

  1. nfr

    PHP Hanging?

    Any ideas? Regards, Neil.
  2. nfr

    WYSIWYG

    I use htmlarea. http://www.htmlarea.com/ Good and easy to integrate.
  3. Well, at the end of the shell script (korn, sh, etc.) just issue the command again. So he would run the script once and before completion the script would set the next job up. E.g. /scripts/myscript.ksh !#/bin/ksh do something at time /scripts/myscript.ksh exit 1 This would basically create an infinite loop until the script were killed and the jobs were deleted from the atq. Regards, Neil.
  4. Something like this: $record_id = $_REQUEST['record_id']; mysql_select_db($database_db, $db); $query = "SELECT audio FROM audio where id=$record_id"; $RS_record = mysql_query($query, $db) or die(mysql_error()); $row_RS_record = mysql_fetch_assoc($RS_record); $audio = $row_RS_news_headline['audio']; <?php echo $audio; ?> You'll have to tidy it up for your application but the above should give you a headstart... Regards, Neil.
  5. nfr

    SQL Problem

    SELECT * FROM stories WHERE (((category = '$news') and ((status != "pending") or (status != "rejected"))) order by article_id desc limit 2; Something like that, you mean? Regards, Neil.
  6. nfr

    PHP Hanging?

    Hi - The code above is the included file ("counter.php"). At I said, it works fine as a direct call through the browser. It causes the page to hang, however, when called as an include in another php file... Regards, Neil.
  7. If you can't use the "cron", why don't you just use the "at" command on the *nix command line? This is basically the "cron" without actually being the "cron" (if that makes any sense!) man at man atq man atrm man batch Regards, Neil.
  8. nfr

    PHP Hanging?

    Hi - I narrowed it down to the following call: <?php include("http://www.website.com/includes/counter/counter.php"); ?> This file contains the following code: <?php session_start(); header("Cache-control: private"); require('../../Connections/leaderdb.php'); $remote_addr = $_SERVER['REMOTE_ADDR']; $http_referer = $_SERVER['HTTP_REFERER']; $http_user_agent = $_SERVER['HTTP_USER_AGENT']; //echo "REMOTE_ADDR: $remote_addr"; //echo "HTTP_REFERER: $http_referer"; //echo "HTTP_USER_AGENT: $http_user_agent"; if(!session_is_registered('online')){ mysql_select_db($database_leaderdb, $leaderdb); $sql_query1 = "INSERT INTO t_people_online (people_online_session_id, people_online_activity, people_online_ip_address, people_online_refurl, people_online_user_agent) VALUES ('".session_id()."', now(), '{$_SERVER['REMOTE_ADDR']}', '{$_SERVER['HTTP_REFERER']}', '{$_SERVER['HTTP_USER_ AGENT']}')"; $result1 = mysql_query($sql_query1, $leaderdb); session_register('online'); } else { if(session_is_registered('user_id')){ mysql_select_db($database_leaderdb, $leaderdb); $sql_query2 = "UPDATE t_people_online SET people_online_activity=now(), people_online_member='y' WHERE people_online_session_id='".session_id( )."'"; $result2 = mysql_query($sql_query2, $leaderdb);     } } if(session_is_registered('online')){        mysql_select_db($database_leaderdb, $leaderdb); $sql_query3 = "UPDATE t_people_online SET people_online_activity=now() WHERE people_online_session_id='".session_id()."'"; $result3 = mysql_query($sql_query3, $leaderdb); } $limit_time = time() - 900; // 15 Minute time out. 60 * 15 = 900 mysql_select_db($database_leaderdb, $leaderdb); $sql_guests = mysql_query("SELECT * FROM t_people_online WHERE UNIX_TIMESTAMP(people_online_activity) >= $limit_time AND people_online_member= 'n' GROUP BY people_online_ip_address") or die (mysql_error()); $sql_guests = mysql_query("SELECT * FROM t_people_online WHERE UNIX_TIMESTAMP(people_online_activity) >= $limit_time AND people_online_member= 'n'") or die (mysql_error()); $sql_guests = mysql_query("SELECT * FROM t_people_online WHERE UNIX_TIMESTAMP(people_online_activity) >= $limit_time AND people_online_member= 'n'") or die (mysql_error()); mysql_select_db($database_leaderdb, $leaderdb); $sql_members = mysql_query("SELECT * FROM t_people_online WHERE UNIX_TIMESTAMP(people_online_activity) >= $limit_time AND people_online_member ='y' GROUP BY people_online_ip_address") or die (mysql_error()); $sql_members = mysql_query("SELECT * FROM t_people_online WHERE UNIX_TIMESTAMP(people_online_activity) >= $limit_time AND people_online_member ='y'") or die (mysql_error()); mysql_select_db($database_leaderdb, $leaderdb); $sql_hits = mysql_query("select * from t_site_statistics_details where site_statistics_id = 1 group by site_statistics_name") or die (mysql_er ror()); $guests = mysql_num_rows($sql_guests); $members = mysql_num_rows($sql_members); if ($myrow = mysql_fetch_array($sql_hits)) { do { $hits = $myrow["site_statistics_value"]; } while ($myrow = mysql_fetch_array($sql_hits)); } echo "<p><span class=\"SiteStatisticsBoldRed\">Website Statistics</span><br />"; echo "<span class=\"SiteStatisticsRed\">Visitors Online: $guests</span><br />"; //echo "Members Online: $members<br />"; echo "<span class=\"SiteStatisticsRed\">Pages Served: $hits</span>"; mysql_select_db($database_leaderdb, $leaderdb); $sql_query4 = "UPDATE t_site_statistics_details SET site_statistics_value=(site_statistics_value + 1) WHERE site_statistics_id=1"; $result4 = mysql_query("$sql_query4", $leaderdb); ?> If I remove the call to the included file, the page loads instantly. There must be something wrong but I cna't see what. If I call the include file directly on the server it also loads instantly. So I don't know why it won't work inside the page... Any ideas? Regards, Neil.
  9. nfr

    PHP Hanging?

    Hi - Just tried now and yes it is. This never used to be a problem before and I have not made ANY changes to the php code. I did, however, have a server failure and am running on another machine. However, this machine is the same spec. Is there a php.ini parameter which may need to be set? Regards, Neil.
  10. Hello - I have an "index.php" file which used to parse fairly quickly. Now all of a sudden it seems to hang for about 30 seconds before completing to load. I have run "php index.php" on the command line and it seems to hang whilst just outputting HTML (actually within a simple table). Why would this happen? (There is no mysql db access at this point and I can't see anything unusual about the php or html.) Any ideas? Regards, Neil.
  11. Hi - I can't figure this out. If I run php from the command line, the version is 4.2.2: admin@machine:/home/d/d/ddp/public_html$ php -v PHP 4.4.2-1build1 (cli) (built: Apr  6 2006 09:44:32) Copyright (c) 1997-2006 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies admin@machine:/home/d/d/ddp/public_html$ However, if I call php through the browser (using phpinfo()), it outputs: PHP Version 5.1.2 Why is this? Regards, Neil.
  12. Direct selects from the database: mysql> select article_creation_date from t_article_details where article_id = 5000; +-----------------------+ | article_creation_date | +-----------------------+ | 20050725133459 | +-----------------------+ 1 row in set (0.05 sec) mysql> select DATE_FORMAT(article_creation_date, '%d/%m/%Y') from t_article_details where article_id = 5000; +------------------------------------------------+ | DATE_FORMAT(article_creation_date, '%d/%m/%Y') | +------------------------------------------------+ | 25/07/2005 | +------------------------------------------------+ 1 row in set (0.01 sec) Here, I asign it to a variable: mysql_select_db($database_db, $db); $query_RS_article_details = "SELECT article.article_edition_number, article.article_id, article.article_title, article.article_author_id, author.article_author_name, author.article_author_email, article_text, DATE_FORMAT(article.article_publication_date, '%d/%m/%Y') as article_publication_date, DATE_FORMAT(article.article_creation_date, '%d/%m/%Y') as article_creation_date, article.article_summary FROM t_article_details as article, t_article_author_details as author WHERE ((article_id = '$article_id') and (article.article_author_id = author.article_author_id))"; $RS_article_details = mysql_query($query_RS_article_details, $leaderdb) or die(mysql_error()); $row_RS_article_details = mysql_fetch_assoc($RS_article_details); $totalRows_RS_article_details = mysql_num_rows($RS_article_details); $article_creation_date = $row_RS_article_details['article_creation_date']; $article_publication_date = $row_RS_article_details['article_publication_date']; $article_modification_date = $row_RS_article_details['article_modification_date']; echo "article_creation_date: $article_creation_date"; echo "article_publication_date: $article_publication_date"; echo "article_modification_date: $article_modification_date"; The output: article_creation_date: 07/06/2006article_publication_date: 11/04/2020article_modification_date: Any ideas? Regards, Neil.
  13. That would make sense... But the field has a value... So if I have the following statement: SELECT article.article_edition_number, article.article_id, article.article_title, article.article_author_id, author.article_author_name, author.article_author_email, article_text, DATE_FORMAT(article.article_publication_date, '%d/%m/%Y') as article_publication_date, DATE_FORMAT(article.article_creation_date, '%d/%m/%Y') as article_creation_date, article.article_summary FROM t_article_details as article, t_article_author_details as author WHERE ((article_id = '$article_id') and (article.article_author_id = author.article_author_id)); ... how do I assign "DATE_FORMAT(article.article_creation_date, '%d/%m/%Y') as article_creation_date" to a variable? I thought that I had done this with: $article_creation_date = $row_RS_article_details['article_creation_date']; echo "article_creation_date: $article_creation_date"; Regards, Neil.
  14. Hello - I have 2 select statements: 1.) select DATE_FORMAT(article_creation_date, '%d/%m/%Y') from t_article_details where article_id = 5000; 2.) SELECT article.article_edition_number, article.article_id, article.article_title, article.article_author_id, author.article_author_name, author.article_author_email, article_text, DATE_FORMAT(article.article_publication_date, '%d/%m/%Y') as article_publication_date, DATE_FORMAT(article.article_creation_date, '%d/%m/%Y') as article_creation_date, article.article_summary FROM t_article_details as article, t_article_author_details as author WHERE ((article_id = '$article_id') and (article.article_author_id = author.article_author_id)); The first gives the desired result: 27/05/2005 +------------------------------------------------+ | DATE_FORMAT(article_creation_date, '%d/%m/%Y') | +------------------------------------------------+ | 25/07/2005 | +------------------------------------------------+ 1 row in set (0.00 sec) The second gives an incorrect result: 06/06/2006 $article_creation_date = $row_RS_article_details['article_creation_date']; echo "article_creation_date: $article_creation_date"; Can someone please explain why?!? It should be the same result in both cases, surely... Regards, Neil.
  15. Hello - I would like to collect details about an individual (Name, Company Name, Telephone Number, Email Address, Web Address, etc.) in a mySQL table and when then form is submitted, automatically download a file (or email) a PDF file containing the information they have requested. What would be the best way of going about this? Regards, Neil.
×
×
  • 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.