Jump to content

fireineyes

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fireineyes's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sounds good. I will do a little studying up on the DATE function.
  2. Would inserting the date like this be better? Found this code on a tutorial page. $query_manual = "INSERT INTO tablename (col_name, col_date) VALUES ('DATE: Manual Date', '2008-7-04')";
  3. Pikachu2000 - You say to change to correct values. Please point me to where I can learn this better if you know a place. In the datatable, I was going to store the months like this.. event | month | year | day =================== car show | 5 | 2010 | 3 meaning May 3, 2010. So what do you suggest? A timestamp? I am pretty new to working with time and dates. What I will be doing is setting up a form for people to submit the date and time of an event. There will be three drop downs in the form for month, day, and year. The values from those drop downs will be entered into the db. Any suggestions are appreciated. At the moment, the way it is listed in my table, it makes it easy to read the datea straight and do a mysql query.
  4. I am using values because I am getting the values of the webpage from the url. For example. If I have this url... http://www.mydomain.com/script/2010/Jan there is a file in the folder called "script" that runs php with a tweak to the htaccess file. Like this: <Files script> ForceType application/x-httpd-php </Files> In the script file, it explodes the url and uses the data in the url to return results. Something like... $REQUEST_URI = $_SERVER['REQUEST_URI']; // BREAK UP THE URL PATH USING '/' as delimiter //////////// $url_array=explode("/",$REQUEST_URI); $url_dates=$url_array[2]; //d is basic home page for dates...maybe show link to all years. $url_year=$url_array[3]; //year $url_month=$url_array[4]; //month $url_day=$url_array[5]; //month if ($url_day) { include('include/day.php'); exit; } elseif ($url_month) { include('include/month.php'); exit; } elseif ($url_year) { include('include/year.php'); exit; } elseif ($url_dates) { include('include/date.php'); exit; } else { Header( "Location: http://www.mydomain.com/classic-car-shows/script/"); exit; }
  5. wildteen88... would that work only if it is a timestamp?
  6. I stored it as text. example row.. Event | Month | Year | Day ============================ car show | Nov | 2010 | 1
  7. I am accessing a mysql table that has a list of events. In each result, there is a month listed. So far, I have been able to make each DISTINCT month echo correctly. I know how to sort alphabetically but not sure the best way to approach trying to put my list in a particular order. Here is what my code looks like.. $query = "SELECT DISTINCT Month FROM event WHERE Year = $url_year"; $result = mysql_query($query); while ($record = mysql_fetch_assoc($result)){ $Mo = $record['Month']; echo '<br>'; switch ($Month) { case 1: echo 'Jan'; break; case 2: echo 'Feb'; break; case 3: echo 'Mar'; break; case 4: echo 'Apr'; break; case 5: echo 'May'; break; case 6: echo 'Jun'; break; case 7: echo 'Jul'; break; case 8: echo 'Aug'; break; case 9: echo 'Sep'; break; case 10: echo 'Oct'; break; case 11: echo 'Nov'; break; case 12: echo 'Dec'; break; default: echo ''; } } The way this is, it simply outputs the months in the order of how they come in the database. I would like to order how these come out. I suspect that I have to put them into an array. Any tips would be appreciated. In the final output, I really want to want to show the months hyperlinked (I did not do that yet in the switch statement) that are found to exist in the mysql table with a month listed. The other months would be un-hyperlinked. The result will be something like: Jan Feb Mar Apr May Jun Jul Aug Sep Nov Dec Based on what months have records listed. Any advice would be appreciated. I am still a little green at php, so if this is a stupid question, pardon my ignorance :-)
  8. the extension makes no difference. I make all the .html and .htm files parse php via editting my .htaccess file. As far as learning html from scratch, that is how I learned is by notepad back in 1997. I can code in CSS and I can do a lot in php (probably more than most newbies around.. learned on notepad as well.. can do everything form if else statement to arrays ect :-) but I was not sure how to include without ranges of text. Suffice to say, I could code circles around most people when it comes to html/css and probably plenty of people in php. I started using FrontPage online editting for the speed. Many of my older sites have it, so why reinvent the wheel when the wheel turns. I can build other sites in the meantime. I will most likely just create seperate "template" files to include and just try to remember to edit both files when updating... simplest thing I suppose. Just was wondering..
  9. Because the site uses Frontpage extensions on a lot of files and I was needing these to include in some php file. I will look at this and see what I can do. I could go in and redo the site in all php but I dont have the time at the moment. Would it be best to copy the file regularly and have a cron set up, and at same time have the regular expression strip out automatically what I need it to?
  10. I want to include html files but I want to remove ranges of text upon include. Like everthing between <html> and <body> including those tags... here is what I am looking at.. I have some pages that I currently include using Frontpage extensions. Those pages require the <html><head> and <body> tags. What I want to do is use the same files included using php but stripping out the code that goes from <html> to the end of the <body> code and also strips out the </body></html> code at the end. I am sure this is easy to do, but I am a newbie and it would be a great help if someone could suggest the best way to include files... reason I ask this is when I include a file like example.html using php includes, is because it gives something like this... Example.html (I am including) <html> <head> <title>title of page</title> </head> <body bgcolor="white"> This is content I want to include <img src="pic"> <p> So on and so on... </body> </html> at moment when I do this code.. . text text text <p> <? include ('Example.html'); ?> <p> text2 text2 etc. etc... it returns this... (notice teh full html code is included from the include page.) text text text <p> <html> <head> <title>title of page</title> </head> <body bgcolor="white"> This is content I want to include <img src="pic"> <p> So on and so on... </body> </html><p> text2 text2 etc. etc... when I want it to look like...(notice the code stripped out from the body tag up and the closing body tag down...) text text text <p> This is content I want to include <img src="pic"> <p> So on and so on... <p> text2 text2 etc. etc... Thanks and I know this is most likely very easy stuff. Thanks for the help.
×
×
  • 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.