Jump to content

denno020

Members
  • Posts

    761
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by denno020

  1. Ahk, very clever silkfire.. I would never have considered the whole -February being a short month- problem. Thankyou for your clarification . Denno
  2. Ok... So when I put 'database_id', I was kinda hoping you'd get the drift of what I was suggesting, and change the name to match whatever it is in your database. What is the name of the id field in your database? This is what you need to put where I suggested 'database_id'.. You also didn't assign anything to the php variable $id... You need to have $id = $_SESSION['id']; somewhere before your query.. Put it just below where you've got $firstname = ' '; Once you have made those changes, let me know how it works. Denno
  3. Please post your whole php file so I can look through it. Also, be sure to post them between the php tags, by doing: [ p h p ] //your code goes here [ / p h p ] (without any of the spaces)
  4. This is how your SQL statement should read SELECT firstname FROM `Members` WHERE database_id=$id database_id will be the id inside your database, obviously.. So you're checking those values for the value contained inside the session id variable, which you have saved into it's very own variable called $id. the $ sign before the name indicates it's a php variable also.. In case you didn't know . Try that and let me know how you go. Denno
  5. you should have done $id = $_SESSION['id']; Then put $id in the query.. Denno
  6. I have managed to solve the problem myself . What I did was convert the date from the database into it's day-of-the-year equivalent, and then compared it to the day-of-the-year of the current date. This worked perfectly . Here it is: SELECT id, name, DOB FROM pp_members WHERE dayofyear(DOB) < dayofyear(curdate())+30 && dayofyear(DOB) > dayofyear(curdate()) ORDER BY dayofyear(DOB) ASC I'm quite happy with this result . Thanks for the help though. Denno
  7. wow that is one confusing line; "first day of this month next month".. What does that convert into? I've been Googling and I've come up with this code that will select everyone who's birthday it is in the current month, however I don't want to show people who's birthdays have already passed, and I would like the birthdays from next month, if within 30 days from the current date, to be displayed.. This overlap of months/dates is where I'm falling short.. However I'm unsure if your code would achieve what I'm after? Here is the code I'm using at the moment.. SELECT id, name, DOB FROM pp_members WHERE monthname(DOB) = monthname(curdate()) ORDER BY DOB ASC Thanks Denno
  8. What you could try doing is assigning $_SESSION['id'] to a variable and then using that variable in the where clause. I have a feeling there is issues when it comes to accessing the session variable directly in the where clause of SQL... I think I've heard of this before.. Denno
  9. I'm not familiar with the use of the curly braces around $_SESSION['id'].. do you have a specific reason for this? This is the line that the error is appearing on, so I would try removing the curly braces, leave the line reading like this: $result = mysql_query("SELECT firstname FROM `Members` WHERE id=$_SESSION['id']"); Denno
  10. session_start() needs to be the very first thing on your page. Move it about session_id() and see what happens.. Denno
  11. In my database I have a field for DOB for each of the records. This field is of mysql type 'date'. I would like to have a script to select only the members who's birthday it will be within the next month.. I'm very unsure as to how to approach the comparison of the current date and the date that is stored in the database... Anyone able to help me? Thanks Denno
  12. So I literally write 'July 7 2011 - 1 week' for the string to time? Wow.. Thanks so much for the help ignace, I will implement it into my site right now . Thanks Denno
  13. You would make the action of your form point to your form processing script (which could be at the top of the form's page, or it could be a new php file), then once the data has been entered into the database (which you said you have already got working), you want to use 'header' to forward onto a new page, instead of loading the form again. header('Location: http://www.example.com/'); //Pulled from php.net Hope that helps. Denno
  14. Do you mean you want the results of a form to be sent to your email address? You should look into a script called FormToMail. It is very easy to configure, all you have to do is open the script, enter your email where it says, and then give the form an action which points to the location of the script. It's heavily commented so you can follow it with ease. Hope that helps. Denno
  15. (continuing from topic title) So if I set a date of July 7 2011 into my script, hard coded in, I would like the current date to be checked against the hard coded date, and return true if the current date is within a week leading up to the hard coded date. How could I go about doing this easily? I've been researching dates in php but I can't seem to work out the best way to achieve what I'm after. Cheers Denno
  16. Your code works for me, but only if I put the full php tag '<?php' not just '<?'.. I didn't use the next_post_link() functions, I just made each of those variables equal to a string, so as to force the set or unset state. And echoed accordingly.. So just try changing the php tags before the ending curley braces. Denno
  17. Thankyou very kindly . I will definitely implement this once I've got some spare time from uni work . Denno
  18. I was wondering how I could consolidate the row id's in my tables? In some tables, I have row id's that go 1, 2, 3, etc, but then jump from say 7 to 10, and then to 14 etc.. This is due to deleting rows that were in between before.. Is there a way I can consolidate these rows so that they're all back in order from 1 to however many there are.. Thanks Denno
  19. yeah it's stop stop the little shift. It's irritating me... More javascript aye lol. I shall look into that too . Thanks for your help dude. And even when I post this in the wrong sub-forum woops. Denno
  20. Thanks mate. Much appreciated. I have already had a look at that site you provided and it looks like a winner, so will have a go at implementing it . Cheers Denno
  21. I have auto margins for left and right for my wrapper to centre it in the page. When the page is longer than the browser window, obviously the vertical scroll will appear. However, when that happens, the wrapper will shift to the left so that it is still in the centre. Is there any way of avoiding this? Thanks Luke
  22. No no I wasn't interpreting that as displaying the images on the front page.. I knew what you meant about loading them into the cache, but not actually displaying them when loaded. I would therefore make them the very last thing to load on the index page right? As they're not going to be displayed anyway.. Cheers Denno
  23. Yeah I was thinking a sprite.. but that would obviously take a little bit of work to stitch all the photo's together and then appropriately move them into position for each person.. Loading the pictures on the frony page sounds interesting.. I could just load like the first 15-20, so part of the page that is in view will display straight away. And then depending on how fast someone starts scrolling down, they'll see the other photo's waiting to load or not.. So for that I will need to search Google for how to load images into cache using javascript? Thanks Denno
  24. Well we're talking about the whole senior squad, so roughly 30-35 images? Could be upwards of 40+ though.. So I'm stuck with just having to optimize the crap out of each of the images? Thats ok, was hoping there might be a trick to have them load last or something or rather..
  25. One of the pages on my football clubs website is going to have lots of player images on it. It's the players page, and it basically shows the photo's of all players (150x113 ~30KB jpg's), along with their number and player sponsor. I want all of the photos to appear on the page, I don't want to separate it up using pagination.. So is there anything else I could do to minimize the load time of the page? Each image is loaded itself, so there will be a lot of HTTP requests, but I don't think sprites will work in this situation.. Very keen to hear any ideas. Cheers Denno
×
×
  • 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.