Jump to content

tomasz1

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

tomasz1's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The size of the file allowable for upload can be set in the php.ini If you have a script and it works on small files, then it is not the script that is the problem, often it is a result of default settings in php.ini. The ini file often needs to be configured for large files sizes, long execution times, and post size. All of these need to be tweaked so your large files can be processed. Also ensure that you have set  MAX_FILE_SIZE in a hidden input preceding your file field(s).         <input type="hidden" name="MAX_FILE_SIZE" value="4000000" ><!--max_file_size value in bytes. --> If you are experiencing ANY error messages when attempting to upload files it could be because: The webserver (as in the webserver process - not you as a user of the web application) does not have permission to write to the files directory(ies). The files directory under dotProject AND its associated subdirectories must have write permissions for the webserver process. You need to ensure that PHP has the following STANDARD PHP SETTINGS sorted out: file_uploads must be set to on post_max_size and upload_max_filesize must BOTH be set to the maximum file size you expect Change the above ini settings. Read: http://www.radinks.com/upload/config.php for more info on ini configurations. Test using http://ca.php.net/features.file-upload script example. Tomasz
  2. I solved this. In case any else finds this useful, here's the fix: The inner while loop condition is: while (odbc_fetch_row($rs2) && $_GET['year'] == $distinctYear) <?php // query to get distinct year from videoDate timestamp column $conn=odbc_connect('test','',''); if (!$conn)   {exit("Connection Failed: " . $conn);} $sql1="SELECT DISTINCT YEAR(videos.videoDate) as distinctYear FROM videos ORDER BY YEAR(videos.videoDate) DESC;"; $rs1=odbc_exec($conn,$sql1); if (!$rs1)   {exit("Error in SQL");} echo '<ul>'; while (odbc_fetch_row($rs1)) { // if this is there first time to the page, we display distinct years. // if they have clicked the year, we use the year from the query string // $distinctYear = (isset($_GET['year'])) ? $_GET['year'] : odbc_result($rs1,"distinctYear"); $distinctYear = odbc_result($rs1,"distinctYear"); echo "<li><a href='$_SERVER[PHP_SELF]?year=$distinctYear'>$distinctYear</a></li>"; // query to get distinct months. if( isset($_GET['year']) && isset($_GET['year']) == $distinctYear) { $selectedYear = $_GET['year']; // query to get distinct months // query to get distinct year from videoDate timestamp column $sql2="SELECT DISTINCT MONTH(videos.videoDate) as distinctMonth FROM videos WHERE YEAR(videos.videoDate) = $selectedYear"; $rs2=odbc_exec($conn,$sql2); if (!$rs2)   {exit("Error in SQL");} echo '<ul>'; // ***HERE'S WHAT FIXED IT. while (odbc_fetch_row($rs2) && $_GET['year'] == $distinctYear) { $theMonth=odbc_result($rs2,"distinctMonth"); switch($theMonth) { case 1: $formattedMonth = "January"; break; case 2: $formattedMonth = "February"; break; case 3: $formattedMonth = "March"; break; case 4: $formattedMonth = "April"; break; case 5: $formattedMonth = "May"; break; case 6: $formattedMonth = "June"; break; case 7: $formattedMonth = "July"; break; case 8: $formattedMonth = "August"; break; case 9: $formattedMonth = "September"; break; case 10: $formattedMonth = "October"; break; case 11: $formattedMonth = "November"; break; case 12: $formattedMonth = "December"; } echo "<li><a href='$_SERVER[PHP_SELF]?month=$theMonth&year=$selectedYear'>$formattedMonth</a></li>"; } echo '</ul>'; } } echo '</ul>'; odbc_close($conn);     ?>
  3. Hello. I hope someone can help me out of a jam. I'm have a data table with a date column containing a timestamp. I want to run a query that retrieves only distinct years that exist, and distinct months that exist. For example. First query gets distinct years from the timestamp. I display them as links. 2006 2005 2004 When user clicks a year above, I want the year to drop open and display months that are available in that year. My code below does this but, I want the other available years to continue to be displayed. This is what I get when user clicks 2004. 2004   January   March   April    May   June   September   October   December. This is fine, for 2004 has entries with those months in the timestamp, but I want to continue displaying the other available years as navigation links, as in: 2006 2005 2004   January   March   April    May   June   September   October   December. Obviously, there is some logic missing...well maybe obviously to someone other than myself ;-). Thanks for any help. <?php // query to get distinct year from videoDate timestamp column $conn=odbc_connect('test','',''); if (!$conn)   {exit("Connection Failed: " . $conn);} $sql1="SELECT DISTINCT YEAR(videos.videoDate) as distinctYear FROM videos ORDER BY YEAR(videos.videoDate) DESC;"; $rs1=odbc_exec($conn,$sql1); if (!$rs1)   {exit("Error in SQL");} echo '<ul>'; while (odbc_fetch_row($rs1)) { // if this is there first time to the page, we display distinct years. // if they have clicked the year, we use the year from the query string $distinctYear = (isset($_GET['year'])) ? $_GET['year'] : odbc_result($rs1,"distinctYear"); echo "<li><a href='$_SERVER[PHP_SELF]?year=$distinctYear'>$distinctYear</a></li>"; // query to get distinct months. if( isset($_GET['year'])) { $selectedYear = $_GET['year']; // query to get distinct months // query to get distinct year from videoDate timestamp column $sql2="SELECT DISTINCT MONTH(videos.videoDate) as distinctMonth FROM videos WHERE YEAR(videos.videoDate) = $selectedYear"; $rs2=odbc_exec($conn,$sql2); if (!$rs2)   {exit("Error in SQL");} echo '<ul>'; while (odbc_fetch_row($rs2)) { $theMonth=odbc_result($rs2,"distinctMonth"); switch($theMonth) { case 1: $formattedMonth = "January"; break; case 2: $formattedMonth = "February"; break; case 3: $formattedMonth = "March"; break; case 4: $formattedMonth = "April"; break; case 5: $formattedMonth = "May"; break; case 6: $formattedMonth = "June"; break; case 7: $formattedMonth = "July"; break; case 8: $formattedMonth = "August"; break; case 9: $formattedMonth = "September"; break; case 10: $formattedMonth = "October"; break; case 11: $formattedMonth = "November"; break; case 12: $formattedMonth = "December"; break; } echo "<li><a href='$_SERVER[PHP_SELF]?month=$theMonth&year=$selectedYear'>$formattedMonth</a></li>"; } echo '</ul>'; break; } } echo '</ul>'; odbc_close($conn);     ?>
×
×
  • 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.