Jump to content

sivarts

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sivarts's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You're right. That really confuses me. Here what I did - when I added the mysql_select_db to the connection script it gave all sorts of errors (on other oages using that connection script) so I just added it to the CRON script and presto! It works!! I think I have been relying on DreamWeaver to do too for me. Thanks Gentlemen for your assistence!
  2. Here's the connection info: <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_myconnection = "localhost"; $database_myconnection = "xxxxxxxx_xxxxx"; $username_myconnection = "xxxxxxxx_xxxxx"; $password_myconnection = "xxxxxxxx"; $myconnection = mysql_pconnect($hostname_myconnection , $username_myconnection , $password_myconnection ) or trigger_error(mysql_error(),E_USER_ERROR); ?> I am not having any other issues with pages that use this script, so I am totally lost. Also,The mixed case example I had above was something I had done just for the example. I am not using mixed case except for the connections directory folder (which again, no probs with the other 40 scripts that use it). All path names look correct and do exist. Thanks for the help!!
  3. You are so right, AndyB now I get: Error: No database selected with query DELETE FROM events_music WHERE event_date < '2006-08-29' doesn't this usually mean I have a prob in the connection string? I can't seem to figure that out if it is the case since all my other Admin pages use the same connection. Any other Ideas what that could mean?
  4. You'll have to forgive me. I am fairly new to the whole new to the whole world of PHP (starting to love it though) Here's my script: [code]<?php // set varibles for todays date $today = date('Y-m-d'); // include connection info include('Connections/myConnections.php'); //select records to delete mysql_query("DELETE FROM events_music WHERE event_date < '$today' "); // close connection to db mysql_close(); ?>[/code] Real simple. Just pulling some records from the DB based on a MySQL formatted date. I am running PHP/MySQL 5 on my local machine and the servier is running PHP4.4 and MySQL 4.1.20-standard-log with Apache version  1.3.37 (Unix) where I am running Apache 2.0.x under windows. As far as I can tell, this code is compliant. Could you point me to some info where I could add some error reporting (sorry I am pretty new at this)?
  5. I've done what micha1701 suggested and it works great on my local machine however, I cannot get it to run on the server usuing CRON or even my running the script from my browser. Does anyone have an idea why this might be?? I have called my host and they say everything looks 'good' so basically they are no help to me. Hopefully someone here can help.
  6. sivarts

    help please

    Would be nice to actually be able to see some of your code. Also, DOCTYPE can affect how CSS will render in your browser.
  7. Ricklord is right, IE renders padding all wrong. Try an jsut using margins when you can. check out www.posistioniseverything.com (maybe .org) for a list of even more IE specific bugs.
  8. Hi Folks. Wondering if any one can help me out here. I've done a tutorial posted on the Adobe Developer center to build a simple calendar that will 'link' the days that have events to those events. Catch my drift (kinda tired...)? I have gone over the code so many times and even  copy/pasted the code from the examples provided from MacroDobia. Basically, I have a recordset that gets all the dates (in MySQL format) for the events (named getEvtDates) and dumps them into an array (see below $dates). I know that the recordset is working and the array is being created (simply with print_r($dates); ) but I still don't have any links in my calendar. Anyone have some time to help me out? It's pretty frustrating... P.S. I am using Dreamweaver to generate most of my code (which I am really good about reading and modifying). Here's the code with some comments... [code]<?php function build_calendar($month,$year,$day) { /* Declaring the variables */ $daysOfWeek = array('Su','Mo','Tu','We','Th','Fr','Sa'); $firstDayOfMonth = mktime(0,0,0,$month,1,$year); $noDays = date('t',$firstDayOfMonth); $dateComponents = getdate($firstDayOfMonth); $dayOfWeek = $dateComponents['wday']; $monthName = date('F',mktime(0,0,0,$month,1,$year)); global $getEvtDates; //this is the name of the recordset global $_GET; if (mysql_num_rows($getEvtDates) > 0) { mysql_data_seek($getEvtDates,0); while ($row_getEvtDates = mysql_fetch_assoc($getEvtDates)) { $dates[] = $row_getEvtDates['event_date']; } } /* Computing the previous month. */ if($month == 1) { $mn=12; $yn=$year-1; } else { $mn=$month-1; $yn=$year; } /* Computing the next month. */ if($month == 12) { $mn2=1; $yn2=$year+1; } else { $mn2=$month+1; $yn2=$year; } /* Calendar header: next and previous month links */ $calendar = "<table>"; $calendar .= "<tr><td><p><a href=get_days_events.php?y=$yn&m=$mn&d=$day>&lt;</a></p></td>"; $calendar .="<td colspan=5 align=center><p><strong>$monthName, $year</strong></p></td>"; $calendar .="<td><p><a href=get_days_events.php?y=$yn2&m=$mn2&d=$day>&gt;</a></p></td></tr>"; $calendar .="<tr>"; /* Calendar header: Display the days of the week */ foreach($daysOfWeek as $day) {           $calendar .= "<td><p>$day</p></td>"; } $calendar .= "</tr>"; $calendar .= "<tr>";   $currentDay = 1;   /* Fill in the beginning of the calendar body */      if ($dayOfWeek > 0) {      $calendar .= "<td  colspan='$dayOfWeek'>&nbsp;</td>";    }   /* Generate the calendar body */   while ($currentDay <= $noDays) {                 if ($dayOfWeek == 7) {                     $dayOfWeek = 0;                     $calendar .= "</tr><tr>";                 } $date = $year."-".$month."-".$currentDay; //here's where the trouble might start if (in_array($date,$dates)) {                   $calendar .= "<td><p><a href='get_days_events.php?y=$year&m=$month&d=$currentDay'>$currentDay</a></p></td>";   } else {   $calendar .= "<td><p>$currentDay</p></td>";   }                             $currentDay++;               $dayOfWeek++; } /* Filling in the end of the calendar body */ if ($dayOfWeek != 7) {            $remainingDays = 7 - $dayOfWeek;           $calendar .= "<td colspan='$remainingDays'>&nbsp;</td>";  }     $calendar .= "</table>"; return $calendar; } if (isset($_GET['m']) && isset($_GET['y']) && isset($_GET['d'])){ $month = $_GET['m']; $year = $_GET['y']; $day = $_GET['d']; } else { $dateComponents = getdate(); $month = $dateComponents['mon']; $year = $dateComponents['year']; $day = $dateComponents['mday']; } echo build_calendar($month,$year,$day); ?>[/code] I know it will be difficult to test this out since you do not have records to play with. But hopefully some one can notice what I am missing. CHEERS (and goodnight!)
  9. Thanks gentlemen for providing me with some code. Both scripts work and I was easily able to edit them to suit my purpose exactly. Cheers
  10. Thanks tomfmason and Barand!! I'll let you know how these work out... Can't tell you how many times the nice people on this forum (like you two) have saved my ass!! All the best to you!
  11. Hi fellow freaks- I have a drop down menu with the following choices- Today, This Week, Next week, This Month. What I want to do is get records from the DB where the results would be from one of the date ranges above. Does anyone know a good way to do this? I tried writing an if/else clause that would perform a query to the DB based on the POST value of the form (where today=1,This Week=2,...) but that won't work since I cannot figuer out how to get the date 7(14,30)days from now. How does one add a number of days to todays date? I searched for about 4 hours on line but could not find anything that a newbie like me could understand to use. I need to some how get a variable $endDate to specify the date range in my SQL query. (which I assume I can write liek this: Select * From myTable WHERE event_date < $endDate --{there are no past dates in the DB at any time}). All my dates are stored in YYYY-MM-DD format (which I cannot change - although I wish I could have used timestamps!). Also, could any one clue me in on how to write something like this: if($_POST['getDays'] = 1) { // go to this page (how do I write this logic to forward to a new page??) } else { if($_POST['getDays'] = 2) { // go to this page } etc... There are so many functions in PHP and I am getting frustrated looking through all the documentaion on line. Does any of this make sense?? I am very lost as what to do-Any help would be much appreciated.
  12. Hello fellow freaks- I have built the calendar using the following tutorial on the Dreamweaver developer site: Building a Blog with DW, PHP and MySQL Part three:Creating a search feature and archiving your blog. I built the claendar and it works fine, but the dates that have records (taken from a recordset and dumped into an array) do not become links as they should. I have been racking my brains over this for too long now and I just can't figure it out. Plus two of my variable are not set which gives me two errors. Heres the code for the function: <?php function build_calendar($month,$year,$day) { /* Declaring the variables */ $daysOfWeek = array('Su','Mo','Tu','We','Th','Fr','Sa'); $firstDayOfMonth = mktime(0,0,0,$month,1,$year); $noDays = date('t',$firstDayOfMonth); $dateComponents = getdate($firstDayOfMonth); $dayOfWeek = $dateComponents['wday']; $monthName = date('F',mktime(0,0,0,$month,1,$year)); global $rsArticleDates; global $_GET; if (mysql_num_rows($rsArticleDates) > 0){ mysql_data_seek($rsArticleDates,0); while($row_rsArticleDates = mysql_fetch_assoc($rsArticleDates)){ [b]$dates[][/b] = $row_rsArticleDates['ArticleDate']; } } /* Computing the previous month. */ if($month == 1) { $mn=12; $yn=$year-1; } else { $mn=$month-1; $yn=$year; } /* Computing the next month. */ if($month == 12) { $mn2=1; $yn2=$year+1; } else { $mn2=$month+1; $yn2=$year; } /* Calendar header: next and previous month links */ $calendar = "<table>"; $calendar .= "<tr><td><a href=day.php?m=$mn&y=$yn&d=$day>&lt;</a></td>"; $calendar .="<td colspan=5 align=center>$monthName, $year</td>"; $calendar .="<td><a href=day.php?m=$mn2&y=$yn2&d=$day>&gt;</a></td></tr>"; $calendar .="<tr>"; /* Calendar header: Display the days of the week */ foreach($daysOfWeek as $day) {           $calendar .= "<td>$day</td>"; } $calendar .= "</tr>"; $calendar .= "<tr>";   $currentDay = 1;   /* Fill in the beginning of the calendar body */      if ($dayOfWeek > 0) {      $calendar .= "<td  colspan='$dayOfWeek'>&nbsp;</td>";    }   /* Generate the calendar body */   while ($currentDay <= $noDays) {         if ($dayOfWeek == 7) {               $dayOfWeek = 0;               $calendar .= "</tr><tr>";         } [b]$date = [/b]$year."-".$month."-".$currentDay; if (in_array($date,$dates)) { $calendar .= "<td><a href='day.php?m=$month&y=$year&d=$currentDay'>$currentDay</a></td>"; } else { $calendar .= "<td>$currentDay</td>"; }   $currentDay++;   $dayOfWeek++;   } /* Filling in the end of the calendar body */ if ($dayOfWeek != 7) {            $remainingDays = 7 - $dayOfWeek;           $calendar .= "<td colspan='$remainingDays'>&nbsp;</td>";  }     $calendar .= "</table>"; return $calendar; } if (isset($_GET['m']) && isset($_GET['y']) && isset($_GET['d'])){ $month = $_GET['m']; $year = $_GET['y']; $day = $_GET['d']; } else { $dateComponents = getdate(); $month = $dateComponents['mon']; $year = $dateComponents['year']; $day = $dateComponents['mday']; } echo build_calendar($month,$year,$day); ?> The two variables on BOLD are the errors (undefined variable). Has anyone done this tut or know what is wrong with the code? I know my recordset is giving valid results (I have tested it). Any help would be much appreciated!!!
  13. Thanks, Barand. I SHOULD have realized that is what was happening. People in this forum rock.
  14. I've used KTML from InterAkt online. The 4.0 version is free to download (after a account activation :-( ) http://www.interaktonline.com/Downloads/Free-Products/ it has worked well for smaller gigs thus far. Cheers!
×
×
  • 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.