Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: PHP questions

  1. #1
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP questions

    I am applying for a job and I need to show them that I can use the internet to find the answers I need. I have just a few questions. What does Alert do, what does TRUNC() do, and what does **ALERT** Date will convert to NULL do. Thanks for any help, JF
    -JF

  2. #2
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Freeman View Post
    I am applying for a job and I need to show them that I can use the internet to find the answers I need.
    Doesn't that then mean that you need to search for answers, rather than ask others to do it for you?
    Mike

  3. #3
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    They said that I could use the internet. That doesn't mean that I can't use the people on the internet as a resource. Think of it as you are part of the internet because that is only how I know you. I have also found most of the stuff myself but I can't find these few things.
    -JF

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Freeman View Post
    What does Alert do
    I don't know of any "Alert" in relation to PHP, but of course there is the global function, alert, in browser object models. You can find more about that, if you need to, in any browser scripting documentation.

    what does TRUNC() do,
    Again, I don't know of a "TRUNC" in PHP, but there is a built-in TRUNC function in SQL. An SQL reference will tell you more.

    what does **ALERT** Date will convert to NULL do.
    That seems a bit muddled, so I can't tell you anything.
    Mike

  5. #5
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    NVM I found what I needed after a couple more hours.
    Last edited by Freeman; 05-14-2007 at 09:53 PM.
    -JF

  6. #6
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Freeman View Post
    I am supposed to tell them all about what this does.
    It should depend upon what DBMS you're using. I would guess perhaps PostgreSQL. It would certainly be very boring under MySQL. I'm still not sure what the "Alert" is all about, though.

    ... I don't know what the numbers in the box_addr_stop,6,1 lines are all about.
    Well, substr is a built-in SQL function, so look it up in a SQL reference.
    Mike

  7. #7
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    while ($row = getrow($result))
    {
    $highest = 0;
    foreach ($row as $value)
    {
    $value = trim($value);
    $transnum = substr($value, (strlen($value) - 5));
    if( $highest < $transnum ) $highest = $transnum;
    }
    }
    What in the frick is this thing doing? It is a loop, thats all I have been able to figure out.
    -JF

  8. #8
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Freeman View Post
    Code:
    while ($row = getrow($result))
    	{
    		$highest = 0;
    		foreach ($row as $value)
    		{
    			$value = trim($value);
    			$transnum = substr($value, (strlen($value) - 5));
    			if( $highest < $transnum ) $highest = $transnum;
    		}
    	}
    What in the frick is this thing doing? It is a loop, thats all I have been able to figure out.
    Think about it logically. A foreach statement is used, which tends to involve an iterable object; an array, for example. There's a variable, $highest, and assignment to that variable later involves a relational comparison using that same variable.
    Last edited by mwinter; 05-15-2007 at 06:39 PM. Reason: De-emphasised a statement
    Mike

  9. #9
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    something inside of me thinks that if you cannot figure that out that you are not ready for a web development "job" maybe an apprenticeship / internship but not a "job"

  10. #10
    Join Date
    Aug 2005
    Posts
    200
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by boogyman View Post
    something inside of me thinks that if you cannot figure that out that you are not ready for a web development "job" maybe an apprenticeship / internship but not a "job"
    In all fairness I started learning this five days ago and I think I am doing pretty good as it is. They know I don't know php but they said as long as I can learn I will be ok. So if this is comparing two things then it is searching for something in a set of predefined guidelines with the appropriate variables. Is it searching or comparing or both?
    -JF

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •