Jump to content

rbragg

Members
  • Posts

    176
  • Joined

  • Last visited

    Never

Everything posted by rbragg

  1. Thanks! But that doesn't work either. I have made SOME progress of my own ... although now both are functioning as the second function would. function cycle() { document.bannerCycle.src = imgArray[index].src; index ++; if (index == 4) { index = 0; } setTimeout("cycle()",2000); return; } function select() { index = Math.floor(Math.random() * 4); document.bannerRandom.src = imgArray[index].src; setTimeout("select()",2000); return; } <body onLoad="cycle();select()"> <h2>My Cycling Banner</h2> <img name="bannerCycle" src="images/1.gif"> <h2>My Random Images</h2> <img name="bannerRandom" src="images/1.gif">
  2. Ok, I put the alert before the return and I don't have any messages.
  3. I did the 3rd function that calls both and it still doesn't work. function functions() { function cycle() { document.banner.src = imgArray[index].src; index ++; if (index == 4) { index = 0; } setTimeout("cycle()",2000); return; alert ("running cycle") } function randomSelect() { index = Math.floor(Math.random() * 4); document.banner.src = imgArray[index].src; setTimeout("randomSelect()",2100); return; alert ("running randomSelect") } } </script> </head> <body onload="functions()">
  4. Of course, I have also tried changing onLoad to onload and it does not help.
  5. Thanks for your reply. I am a PHP person and typically stay away from JS. However, I'm taking a class that requires its use. A textbook uses <BODY onLoad="blahblah">. I have added alerts: function cycle() { document.banner.src = imgArray[index].src; index ++; if (index == 4) { index = 0; } setTimeout("cycle()",2000); return; alert ("running cycle") } function randomSelect() { index = Math.floor(Math.random() * 4); document.banner.src = imgArray[index].src; setTimeout("randomSelect()",2000); return; alert ("running randomSelect") } But, I don't get alerts on page load.
  6. I have a 2 functions that I need to load in the body tag. I have read that you should separate them with a semi-colon but this is not working for me: <script> function cycle() { document.banner.src = imgArray[index].src; index ++; if (index == 4) { index = 0; } setTimeout("cycle()",2000); return; } function randomSelect() { index = Math.floor(Math.random() * 4); document.banner.src = imgArray[index].src; setTimeout("randomSelect()",2000); return; } </script> </head> <body onLoad="cycle();randomSelect()"> Any suggestions? Thanks.
  7. I don't know! That's what I'm trying to find out. LOL! I get the same date each time I echo on the page. Two records that have different dates stored in the db both result in Dec 31, 69 @ 07:00 pm when I have this: <?php $detailDate = ociresult($callDetails,"DETAIL_DATE"); echo date("M j, y @ h:i a", $detailDate); ?>
  8. ociresult is the same thing as oci_result. There are 20 other queries on other pages that correctly work with that syntax. oci_result is used in PHP 5. ociresult is used in PHP 4 & 5. I'm using 4.
  9. Like in my first post: <?php $detailDate = ociresult($callDetails,"DETAIL_DATE"); # retrieving from query where field = DETAIL_DATE echo date("M j, y @ h:i a", $detailDate); ?> The field in my db is a TIMESTAMP. I don't imagine you'd need my actual query.
  10. Thanks for the link. I have read this before coming to post. The The Dates and Times in PHP section would apply to me. Unfortunately, my method, like this method, is not working. :-X On an earlier page, I INSERTed sysdate as a TIMESTAMP. Now, I'm just trying to pull the stamp from the db and formatting it. Even ... <?php echo date("M j, y @ h:i a", $detailDate); ?> ... gives me Dec 31, 69 @ 07:00 pm from the timestamp 06-SEP-07 12.03.31.000000 PM.
  11. Ok, I don't want to rearrange my formatting. I would like to keep the "Mon day, year @ Hr:min" format instead of the format you have and the periods. I want to keep this: Sep 7, 2007 @ 10:38 am. However, I don't think the format has anything to do with why my date is not displaying correctly. No matter the formatting, I'm getting the wrong date and time.
  12. Thanks for your reply. Changing the case of "M" only changes the month from the name to the number. So, now I have 12 31, 69 @ 07:00 pm. Wait, I'm re-reading since you edited.
  13. I have an Oracle db that has a column called DETAIL_DATE with a TIMESTAMP datatype. I have successfully stored current system times there. I am trying to format the date and time to my liking. I've read a bit about to_char() but I don't want to do the formatting inside of my query. Of course, the following gives me 06-SEP-07 10.38.30.000000 AM : <?php $detailDate = ociresult($callDetails,"DETAIL_DATE"); echo $detailDate; ?> How can I format the date after fetching it using Oracle/PHP functions? I have also tried echoing: <?php echo date("M j, y @ h:i a", strtotime($detailDate) ); ?> But 06-SEP-07 10.38.30.000000 AM incorrectly turns into Sep 6, 07 @ 12:00 am. I've also tried using strftime instead of strtotime.
  14. Thanks for all of you replies. I figured it out. Of course, I needed ocifetch($room);
  15. What I meant was that I have tried both methods and both let me count the matches. My problem is that after that, I would like to get the data contained in one of the fields (room_num) and that is not happening with either method.
  16. lemmin, I have used ocirowcount: $roomMatch = ocirowcount($room); When I print $roomMatch I correctly get 1. My problem is that inside the if statement, I am trying to then use values in that one record: $roomNum = ociresult($room,"ROOM_NUM"); But, $roomNum is empty even though there is a value in the db.
  17. Thanks for the replies! Ginger, there IS a match there and I'm testing it. I have an else part of the script commented out, which will be used in production. lemmin, I am using this same count and ociresult() in another page when matching user/pass to the db. So, I know it works. ???
  18. What you say makes great sense. Let me explain what I'm trying to do. I'm checking the db for a match to $_SESSION['room']. If there is a match, I want to get the room_num of that room. So, I'd like to keep the > 0 operation. I know how to do this in mySQL but am learning SQL and am uncertain.
  19. Ginger, $connect is defined b/c I use this variable in other queries on the page like INSERTs and those values are successfully entered into the db. lemmin, the error: [Fri Aug 24 15:38:23 2007] [error] PHP Notice: Undefined variable: roomNum in (omitted directory structure)\\addcallconfirm.php on line 224 Thanks for continued help!
  20. $roomMatch > 0 is true ... there is a match. I have errors turned off on the server but am checking the logs. The above error is what is in the log.
  21. Why would the following give PHP Notice: Undefined variable: <?php # see if room already exists $queryRoom = " SELECT NVL(COUNT(*),0) AS ROOM FROM schema.table WHERE room = '" . $_SESSION['room'] . "' "; $room = ociparse($connect, $queryRoom); ociexecute($room); $roomMatch = ociresult($room, "ROOM"); if ( $roomMatch > 0 ) # found existing room name { $roomNum = ociresult($room,"ROOM_NUM"); } echo "<br>room_num of match: " . $roomNum; ?> I had entered data into the field objects. They SHOULD have been set. I'm trying to figure out why they are not.
  22. The following gives me: HP Warning: ociexecute(): OCIStmtExecute: ORA-00933: SQL command not properly ended <?php $queryLastCall = " SELECT call_num FROM schema.table ORDER by call_num DESC LIMIT 1 "; $lastCall = ociparse($connect, $queryLastCall); ociexecute($lastCall); $callNum = ociresult($lastCall, "CALL_NUM"); ?> It may be of importance to note that I have many queries on this page and this is the only one where I do ORDER and LIMIT clauses. Thanks in advance!
  23. Thank you MadTechie! The problem was that I had: $hallList = ociresult($hall,"HALL"); instead of: $hallList = ociresult($hallResults,"HALL"); :-X By the way, I also changed: while( $hall = ocifetch($hallResults) ) back to: while( ocifetch($hallResults) )
×
×
  • 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.