-
Posts
738 -
Joined
-
Last visited
Posts posted by SkyRanger
-
-
Thanks. I figured out how to remove it and it fixed the problem. Thanks again
Oh anybody that has this problem. Go into the code right click choose encoding... Choose unicode(UTF- and ensure that add BOM is unchecked.
-
Yeah, I just checked Microsoft Expression 4 and it inserts a BOM, now I have to figure out how to remove it.
-
Ok, not sure what the problem is....hard to explain. I am trying to setup a login script but I get the normal: Warning: session_start() [function.session-start]: Cannot send session cache limiter error code. I have no white space above to cause problem. I have used this same code written by Jpmaster77 on a number of sites. What the strange thing is it also messed up a couple of my css text boxes.
See the difference:
http://www.monstersgonewild.ca/index.php - Problem
http://www.monstersgonewild.ca/index1.php - Without session()
I would post the code of the original page but it is 600+lines and growing.
Anybody have any ideas?
-
k, I am dumb as a brick. If it wasn't for PFMaBiSmAd helping me with the initial PHP code. I would still be pulling out my hair to figure it out. Does anybody know where I can find a tutorial to even start to try and figure out what I need to do.
-
Can somebody please have a look at this. The Problem I am having is that only 1 entry for each month goes into the tree and for the life of me I can't figure out why.
$queryyp = "SELECT YEAR(date) as year, MONTHNAME(date) as month, title FROM monsterpost ORDER BY date DESC"; // query to get the rows you want in the order that you want them, with the year and monthname specifically selected as well $resultyp = mysql_query($queryyp); $last_heading = null; // remember the last heading (initialize to null) while($rowyp = mysql_fetch_assoc($resultyp)){ $new_heading = $rowyp['year']; // get the column in the data that represents the heading $new_subheading = $rowyp['month']; // get the column in the data that represents the subheading if($last_heading != $new_heading){ // heading changed or is the first one $last_heading = $new_heading; // remember the new heading $last_subheading = null; // (re)initialize the subheading // start a new section, output the heading here... echo "<ol class=\"tree\"><li><label for=\"folder1\">{$rowyp['year']}</label> <input type=\"checkbox\" id=\"folder1\" /></li></ol>"; } // subheading under each heading if($last_subheading != $new_subheading){ // subheading changed or is the first one $last_subheading = $new_subheading; // remember the new subheading // start a new section, output the subheading here... echo "<ol><li><label for=\"subfolder1\">{$rowyp['month']}</label> <input type=\"checkbox\" id=\"subfolder1\" />"; } // output each piece of data under a heading here... echo "<ol><li class=\"file\">{$rowyp['title']}</li></ol></li></ol></li></ol>"; }
-
Nevermind. Figured out the space problem.
-
I know I am probably pushing my luck. Been playing with the code trying to do different things with it. Is there a way to separate the month. If I am being to much of a bother just say figure it out yourself......lol
2012
March
entry
entry
February
entry
entry
Trying to put it in a drop down menu now....but thank you again for you help.
-
OMG PFMaBiSmAd That is exactly what I needed. That works perfectly. I owe you BIG time. This would have taken me a month to even get a start on figuring out how to do that. I have been picking away at it and reading over the other posts since you posted last. Again thank you.
-
Thanks PFMaBiSmAd. But after staring at the examples you gave. I am more lost than I was before....lol.... I am a real noob when it comes to complex php code. Doing the basics like showing everything in the table is about all I can do. Thanks for your help anyhow. Hopefully over time and allot of practice I will figure it out.
-
Thank you. I am looking through the other posts that you sent me the links for. That looks exactly what I need. Thanks
-
Ok, not sure what is going on. That isn't working Anon-e-mouse. Still not sure what problem is. Only shows 2 entries out of 4 and not even the right 2.
-
I am trying to get a group by to work but for some reason it will only display one output. Not sure what the problem is.
mpid mpyear mpmonth mpday mptitle 4 2012 3 2 Text stuff here 3 2012 3 1 Day 1 stuff here 2 2012 2 28 Feb stuff here 1 2011 12 27 First post test here So what I am trying to do is sort out per year month ie: 2012 3 Text stuff here Day 1 stuff here 2 Feb stuff here 2011 12 First post test here
That is what I eventually want it to look like, but first thing I need to do is get atleast the mptitle to group first.
$query = "SELECT * FROM monsterpost group BY 'mpmonth'"; $result = mysql_query($query) or die(mysql_error()); // Print out result while($row = mysql_fetch_array($result)){ echo $row['mptitle']; echo "<br />"; } ?>
-
Ok. Thought I fixed the problem but guess not. Changed the tables to work a little easier but still not working.
This is the problem I am having.
Table Data:
mpid mpyear mpmonth mpday mptitle
4 2012 3 2 Text stuff here
3 2012 3 1 Day 1 stuff here
2 2012 2 28 Feb stuff here
1 2011 12 27 First post test here
So what I am trying to do is sort out per year month
ie:
2012
3
Text stuff here
Day 1 stuff here
2
Feb stuff here
2011
12
First post test here
This is what I have tried with now luck just repeats year month title for each entry $resulty = mysql_query("SELECT * FROM monsterpost order by mpid desc limit 1") or die(mysql_error()); while($rowy = mysql_fetch_array( $resulty )) {
Any help would be greatly appreciated.
-
No looking at it, it might now even be possible with the way I have the date. I may have to break it up into different cells and pull it out one at a time and then combine them out put everything for the year and month
-
Hello, not sure if lack of sleep or just staring at code too long.
This is what I have:
while($rowy = mysql_fetch_array( $resulty )) { mpdate = YYYY-MM-DD $date = $rowy['mpdate']; $year = explode('-', $date); $month = date("F", mktime(0, 0, 0, $year[1])); ?> <?php echo $year[0]; ?> <br> <?php echo $month; ?> <br> <?php echo $rowy['mptitle']; } ?> I figure if I use: if ($year[0] == date('Y"){ echo month and entry stuff } but I keep getting errors.
What I am trying to do is sort everything out into year month and day
ie:
2012
March
Entry 1
Entry 2
February
Entry 1
Entry 2
Entry 3
etc...
This is what I am getting
2012
March
Entry 1
2012
March
Entry 2
2012
February
Entry 1
etc...
Is there a way to fix this?
-
It worked. Thanks Pikachu, greatly appreciated.
-
Hello,
I seem to be having a problem. I am trying to extract the year from a date
2012-03-01 echo "2012"; I have tried this and it only displays 1969 $dateorig = "2012-03-01"; $new_year = date("Y", strtotime($dateorig)); echo $new_year;
-
Nevermind. Figured it out. Had to use mktime to get it to work.
$month_number = $rows['smonth']; $month_name = date( 'F', mktime(0, 0, 0, $month_number) ); echo $month_name;
-
I am trying to convert Numbers to months from mySQL. What I current have in my db is smonth = #
What I am trying to figure out is if there is a way to do an array that will convert the # to a month instead of use if $smonth = 1 echo January.
Any help is greatly appreciated and thank you in advance.
-
Nevermind, got it finally, have to use switch but need to use it correctly, found my mistake.
-
Hi Guys,
This is what I am trying to do. I have multiple link one 1 page and when a user clicks on that link it will print that file for them.
page.php containts 20+ images image1 - Print image2 - Print image3 - Print etc.... <a href="page.php?cid=1">Print</a> <a href="page.php?cid=2">Print</a> <a href="page.php?cid=3">Print</a>
So what I need to do is if user clicks cid=2 then it goes to page.php?cid=2 shows the image and prints with javascript.
That is not a problem I already to this with html but I am changing over to php mysql due to simplicity and ease of use. and also to reduce to pages from 30+ pages down to 1 page for this section.
so this is what I am having trouble with
switch($cid) case $cid { echo image and print } default { echo all images and print link }
So the problem I am having is the case $cid
The problem is that this is so simple and I have been playing with it for so long I don't see the fix.
-
Figured it out, for 1 thing, had the stuff backwards, and second should have used !empty instead of isset:
$eventstart = $rown['starttime']; if(!empty($eventstart)) { echo $rown['starttime']; } else { echo "All Day"; }
-
I am having a problem trying to show if cell is empty echo one thing if empty and starttime if there is one:
if(isset($rown['starttime'])) { echo "Add Day"; } else { echo $rown['starttime']; }
-
Decided to just use buttons instead, the drop down was being to much of a pain, thanks for you help guys, got the multi delete to finally work, will work on the multi edit later.
Time Zone
in PHP Coding Help
Posted
Having a problem since the time change of 1 hour.
Times now show 2:08 when it is 3:08
I am using:
Any way to fix this to show corrent time?