Jump to content

j.smith1981

Members
  • Posts

    333
  • Joined

  • Last visited

    Never

About j.smith1981

  • Birthday 08/08/1981

Profile Information

  • Gender
    Male
  • Location
    Harrogate, North Yorkshire

j.smith1981's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hello I was wondering if it would be alright to ask about this loop please? This loop here (I have changed some of it to show that I am making an effort but struggling to understand it 100%) I hate it when I want to use something but lack a thorough understanding of a little snippet of code, here's it and my assumptions below: <?php for($i = ($current_page - $show_links); $i < (($current_page + $show_links) + 1); $i++) // this bit I am struggling with, the condition for the loop only! { // if it's a valid page number! if(($i > 0) && ($i <= $total_pages)) { } } The bit I don't get is say I was on my 4th page out of 25 total pages right? (just for arguements sake) I then have 5 links shown at any time, so -4 as my value in the brackets right? I don't get what would happen if that was to occur, that's my problem can someone help me to understand this better what's actually really going on with this logic please? Thanks ever so much in advance, Jeremy.
  2. Ahh yes I output the SQL and it makes perfect sense. Thank you so much it's just pagination had been bugging me for a good few months and knew I would go back to it at some point, still struggling with a few of the last points but I am getting there. Thank you so much. Jeremy.
  3. Hi there I am having a bit of a trouble understanding what I think this pagination variable means as a literal value, though I know of course it's going to be dynamic but I wanted to make sure I was thinking the right way about this. This is going by this tutorial here: http://www.phpfreaks.com/tutorial/basic-pagination With reference to this part here: If I was on page 1 at the moment I would go from 0-9 and see those results right? If I then went to page 2 that would be (would that be 11) deduct 1 and then 10-19? I am getting a bit confused, I think I have it but I mean I just wanted to double check. Any helps much appreciated, Jeremy.
  4. Much appreciate that reply as I said originally! Haha I do that sometimes myself no worries at all, I mean think someones talking in one context and means another lol. But no I every time I have tried doing that myself it never seems to work but going to give that another bash nesting functions, it makes sense if the child function as you so rightly put it isn't going to get called from outside the parent function, makes sense I suppose. It's just due to one not working before I though it was incorrect syntax in a book, but will do an exact example but by nesting them to the example I was working on before, the reason why I asked this question. Thanks ever so much again! Jeremy.
  5. I wasn't talking about OOP at all with this post. Recursion is purely a function that is called that within that function, that data's meets a certain critera then another function is called based upon that criteria and then sends that result back to the function which was called in the first instance (I actually missed the latter part out) and then sends the data back to the logic of your application obviously. All I was asking can you put a function within a function or is this illegal syntax? That's all sorry for any confusion but that's all I was asking.
  6. Hi there, I don't know if this is the correct part of the forum but I am wanting to figure out something about recursion, kind of questioning someone elses code. It's just a general rule though so there's no real need to display it I don't think. However when I say I want to get a function to call another function, would I need to declare (write) the 2nd function within the function that called it? I just am questioning what I saw in another book whereby what I create does not work on my own basis but does when someone else shows an example in a book, where the author created a function that called a function that was written within another, is this legal syntax though is my main question? Kind of looked somewhat like this (very basic and no actual commands or instructions here): <?php function myfunction() { // if whatever condition is true, call the second function just below me: function mysecondfunction() { } } Does that make any sense to you? Or would I just go off the book I am reading now where the 2 of them are completely seperated and the first function calls the 2nd, but not actually putting a function within another? Any advice is much helpful, Jez.
  7. Notepad++ all the way for me, end of story lol.
  8. I just thought I would hit reply without looking at any other posts when reading the first one. The 2 ones I enjoy reading: Wrox Beginning PHP6 and MySQL (yes I know there's no such version as PHP6 but it is not a bad book, if your willing to go in and amend some of the things the author does, spend allot of time doing, which is not really a bad thing, coupled with this site forum and that book it's amazing). I will of course look at this book though the one the OP posted, will give that a good read, it's good occasionally to unlearn what you have already learnt and start off again, I mean I know about typecasting, since I spent an hour (literally just an hour), trying to work out where I could put in type casting. Can fit into many different areas you don't usually think about. Also a CSS book I am reading at this moment in time is: CSS Mastery by Andy Budd. Apologies if anyones put these up already, I will just go by saying their 2 pretty decent books, though there's probably better ones than the PHP one I just mentioned lol.
  9. I personally for servers love ProFTP. Though I really need to set ports for my 3 virtual hosts rather than going off the same one and using 4 different files. Will get that sorted when I can be bothered lol.
  10. I cant for the life of me remember what to do here, as I am in a bit of a rush to get the majority of this annoying report done, I thought I would ask you guys, since you've always come back with a good response. Right I have this in a bit of html: I want it to come back with a true value like in an SQL statement for MySQL like: Would output as: Would be the end result, I just am racking my brain at the moment trying to remember, the person to come back with this one would be the best person in the entire world!!! Kind regards, Jeremy.
  11. Ah I have got it, just wasnt working because I had set the selection box values as names not actual value=""> and thats why it wasnt working.
  12. I have a question. When you create radio buttons, I want to have a different SQL query and results page per radio button, as per the below, where if one radio button is selected it shows the relevant results in a web page. How is the best way, with a basic 2 just to start myself off on the right foot so to speak? Postcode Sales Picking sheets Thanks, Jeremy.
×
×
  • 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.