Jump to content

dabaR

Members
  • Posts

    189
  • Joined

  • Last visited

Everything posted by dabaR

  1. Here is an example: "SELECT * FROM orders where order_time between '" . date('Y-m-d 18:00:00', strtotime('yesterday')) . "' AND '" . date('Y-m-d 18:00:00', strtotime('today')) . "';" This is basically same as andrewgauger was saying, but complete and a little clearer, IMHO.
  2. Well, I would like to start discussion with pointing to sf.net and ubuntu.com Those are two places where I commonly get my apps. A lot of the time places to download apps provide more than just that, namely project hosting in terms of version control repositories, email, web hosting...
  3. Hi. I'm new too! So do you have some GNU/Linux servers there, or are you a sucker? Just kidding; the reason I ask is because we use cron jobs, along with an emailing script for tasks like the one you described. Here's the architecture: Every day, at 6AM, a script is ran, that sends out email reminders for db records that have the NotifyDate = current date. The cron job syntax/usage can be learned here: http://www.pantz.org/software/cron/croninfo.html Sending emails with attachments can be done using the SwiftMailer package: http://swiftmailer.org/docs/sending-quickref
  4. Hi there. This is a waay better piece of software: http://swiftmailer.org/docs/sending-quickref Let me know if you can try to use that.
  5. Are you saying that you have a PHP script that basically takes an excel file, and loads it into mssql as a new table with all the columns and rows from the excel file?
  6. $rvote = mysql_query("SELECT * FROM `Reply` WHERE keywords='$search'"); $rfound = mysql_num_rows($rvote); $max_totalcount = 0; while($maxrow = mysql_fetch_assoc($rvote)) { $pos = $maxrow['Positive']; $neg = $maxrow['Negative']; $totalvotes=$pos+$neg; $count1 = $pos / $totalvotes; $count2 = $count1 * 100; $totalcount = number_format($count2, 0); if ($totalcount > $max_totalcount) $max_totalcount = $totalcount; } echo $max_totalcount;
  7. The if statement on the top is never closed. In fact, is all this code only supposed to run if isset($_POST['submit'])? If so, then remove line below //Pull ID field from table VIP if(isset($_POST['submit'])) {
  8. UGH, that looks super nasty. What if the user enters a space into one of the fields then? How about using fputcsv instead? http://php.net/manual/en/function.fputcsv.php You would then have something like: ... $fp = fopen("data.txt", 'ab'); fputcsv($fp, array($name, $accno, $dt, $lvisit, $rcall, $com)); fclose($fp); ?> However, if the user enters a double-quote ", then you are in the same predicament later when reading the data as if you had a space in the data, and a space was a delimiter. You could use http://ca3.php.net/manual/en/function.addslashes.php on each of the variables you are storing in the file, and http://ca3.php.net/manual/en/function.stripslashes.php on each field when you are reading the data. Hope that helps! -- Dan Bernardic http://dan.bernardic.ca
  9. document.location.href= document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value Let's do it backwards: .value = the value of options[document.nav.SelectURL.selectedIndex] = the selected option of (this is basically a lookup into an array, array[index]) document.nav.SelectURL = the SelectURL select box, that is inside the nav form, that is inside the document(the whole HTML document) So all in one sentence: The value of the selected option of the SelectURL select box, that is inside the nav form, that is inside the document = document.nav.SelectURL.options[document.nav.SelectURL.selectedIndex].value Hope that helps! -- Dan Bernardic http://dan.bernardic.ca
  10. Hi there. In general you want to post the code that is generating undesired output. Then I could modify it to work exactly. Do you want >= startdate and <= enddate? That would include the dates on which something starts and ends. Otherwise you get just the dates in between. The error is likely because you need to have '2010-06-01' within quotes like that, and you can get that with something like "'" . date('Y-m-d') . "'"
  11. I think a while loop instead of recursion in this case would make more sense, but that's just me. Try ++$num for the thing your question was about. Although Ken beat me to the punch.
×
×
  • 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.