ajoo
Members-
Posts
871 -
Joined
-
Last visited
-
Days Won
1
Everything posted by ajoo
-
my webpage has deserted my login page ! please help.
ajoo replied to ajoo's topic in PHP Coding Help
Hi ! I am not sure I get what you are saying, but I think you mean that I need to split the dynamic.php and take the header and other files and include that in the demo files html/ php section. If that was the case it would destroy the modularity of the dynamic.php file. Wouldn't there be a better more elegant way of doing this ? I am not sure I understand. Would you please do whatever you are suggesting to me and show me what you mean ? Thanks loads. -
selecting/searching rows of a Table based on the value of a field in the table.
ajoo replied to ajoo's topic in MySQL Help
Hi Guru ! Surely you must be one ( a guru ) to think of a query like the one above. I'ld be grateful if you can please explain the query that you have devised and also your modus operandi to think so straight while creating a query like this ! I'ld sure love to emulate your thought process. Please do explain how the query works by breaking it up like you have done . Thanks and very grateful. Ajoo- 22 replies
-
- ajoo
- conditional search query
-
(and 1 more)
Tagged with:
-
my webpage has deserted my login page ! please help.
ajoo replied to ajoo's topic in PHP Coding Help
Hi ! I am back with a set of files zipped neatly into one. Please find the project attached. The last line in the demo.php namely php include("dynamic.php"); attaches the dynamic website to the login page. But clicking on any of the buttons detaches the website from the login panel. I can see that it is wrong but i am unable to make out how else to attach the files so that they may be welded together. Thanks for any help. dynamic.zip -
my webpage has deserted my login page ! please help.
ajoo replied to ajoo's topic in PHP Coding Help
hmmm ! Ok I'll see what i can do. I'll try and put the code in here in a little while. Thanks. -
my webpage has deserted my login page ! please help.
ajoo replied to ajoo's topic in PHP Coding Help
Hi ! Ok so the dynamic web page is a simple web page which simply displays a message for the various buttons on the menu bar in a select area. so for e.g. if i press the contact button, it say "this is a contacts page" and another message for another button on a common message DIV area. So all these messages appear on the same DIV area for messages. Of-course any functionality can be provided instead of just displaying the message. So that's the simple dynamic website that's there for now. Different html pages hold the messages for the various menu buttons. In the main html file includes are used to get them all together. The body.html is where a conditional structure is used to check which menu button ( not button actually ) has been pressed and the corresponding message is displayed. Now I used this and placed it on the page for jquery login. The first time it displays great and all is well. But when i press any of the buttons, the query panel disappears and only the dynamic website page with all its functionality intact is left. I have no clue why and so I am making this request. Thanks again. -
Hello All ! I have been learning and doing at the same time. I came across a login design using J-query sliding panel, that i gratefully used. The rest of the query page was empty. Then I came across a tutorial on dynamic pages and so I thought it would be a good idea to put this dynamic page on the front of the login j-query page. I did so and it worked. When i use the J-query panel it worked fine. Then i implemented the dynamic pages and when i tried that out, the jquery panel vanished and the dynamic page appeared as a standalone website. Any ideas how I may retain my login and the dynamic page and let them work harmoniously together. Thanks all in advance.
-
Hi all ! I am very new to mysql and i am trying to learn. I need a little help. I have a small table with 4 fields namely Day_ID, Dues, Last_Visit, Points. where Day_ID is an auto-increment field. The table would be as follows: Day_ID -- Dues --- Last_Visit --- Points. 1 --------- 900 -------- 1/12 -------- 6 2 --------- 700 -------- 4/12 -------- 7 3 --------- 600 -------- 7/12 -------- 5 4 --------- 600 -------- 9/12 -------- 6 5 --------- 600 -------- 10/12 ------- 6 6 --------- 600 -------- 14/12 ------- 6 So this is the record of a person's visit to say a club. The last row indicates the last date of his visit to the club. His points on this date are 6. Based on this point value of 6 in the last row I want to retrieve all the previous BUT adjoining all records that have the same Points i.e. 6. So my query should retrieve for me, based on the column value of Points of the last row (i.e. Day_ID - 6 ), as follows: 4 --------- 600 -------- 9/12 -------- 6 5 --------- 600 -------- 10/12 ------- 6 6 --------- 600 -------- 14/12 ------- 6 Can someone show me how this may be achieved? Thanks all in advance for sharing their knowledge and time. P.S. I am not attaching a Table as its a very small example. I hope that's OK.
- 22 replies
-
- ajoo
- conditional search query
-
(and 1 more)
Tagged with:
-
how to step up and down through the result of an sql query
ajoo replied to ajoo's topic in MySQL Help
Hi vinny, I checked what you said and its definitely something to watch out for. This is how i used it. I used seek to find the records with the LIKE command and then once i have the record i want to edit, I make changes to it based on its primary ID or email address which is again unique. SO that ways i get the editing done on the correct record. Do you see any issue in this now ? Your comments and thoughts are very welcome. Thanks loads. -
how to step up and down through the result of an sql query
ajoo replied to ajoo's topic in MySQL Help
HI vinni, I guess you are right. I am rather new to mysql and it never occoured to me that the record would change while we are viewing the searched subset. I'll keep that in mind and think about it and get back. Thanks loads -
how to step up and down through the result of an sql query
ajoo replied to ajoo's topic in MySQL Help
Hi Ch0cu3r, Thanks for the hints and the tutorial. Much obliged. data_seek seems to be the way out I think. Thanks for the pointers. -
how to step up and down through the result of an sql query
ajoo replied to ajoo's topic in MySQL Help
Hi vinny ! thanks for the response. OK so I was just trying to create a data entry form you know. Where an operator will key in entries to the data base via this form. He can do that one at a time. Then he may need to edit one of those entries at a later time. So he may need to search for a record and find the entry he wants to edit. The search can generate many entries in case he is not sure , say of the exact entry id or the name of the concerned person in that entry whose form he wants to edit. So a LIKE search query can generate many search entries and he may need to step thru each one before he finds the one he wishes to edit. I hope I am able to explain & make you understand the problem now. Thanks -
type = Button & onclick() type of functionality for php, static_variables
ajoo replied to ajoo's topic in PHP Coding Help
Hi trg, I am trying to use Session variables. Will let you know if i succeed. Thanks. -
type = Button & onclick() type of functionality for php, static_variables
ajoo replied to ajoo's topic in PHP Coding Help
Hi Trq, Thanks. Is that a no to static variables as well? If I cannot use static variables then the only option I see is to use $_SESSION variables. Would that be elegant? I am going back and forth between a form draw and the corresponding code depending upon one of the two buttons pressed. The count of the record is important for both the buttons. When i go thru one routine to the form and back to the routine, i lose variable values? I wonder if this is comprehensible. lol. So I am stuck Thanks -
how to step up and down through the result of an sql query
ajoo replied to ajoo's topic in MySQL Help
Thanks guys ! I'll try thr first 2 but i am not sure I understand pagination. Would be happy if Guru mac_gyver can explain that concept a bit in detail. Thanks loads -
Hi guys, I am stuck with this seemingly simple problem. I run a query on a MYSQL database and say it returns 4 rows of result. Now every where on the net I have found that this result can be stepped through using a while loop. But if i wanted to step through this loop one at a time and wait like at the end of each loop before proceeding further how can that be done? OR say I wanted to go to the 3rd result in the result set and display it and then GO BACK and display the 2nd result how can i do so. This would be a great help if someone can provide a solution Thanks all.
-
Thank you sir !! In fact i found another method which I'll post here echo strtotime('2011-02-27 02:04:46'); // 1 SAME AS BARAND - THANKS $dt = new DateTime('2011-02-27 02:04:46'); // 2 echo $dt->format('U'); Thnaks loads. hope this will help some more like me.
-
Hi guys, I found that this much asked question on the net has no real straight forward answer. So i ask this again. $date = ('2013-07-08 12:30:30'); how can i change this date to a Unix time stamp in the simplest possible manner just as it is possible to convert a timestamp to datetime in one line. Thanks to all again.
-
How can I know what my timezone is ? I have apache server installed on my machine and the time that my Apache server gives me is different from the system time on my machine. To be exact. The time showing on my machine is 12.50 PM on 10th Aug, 2013. but the time given to me by the Apache server is 2013-08-10 09:20:45 where the time is 9.20 AM. So it shows a time difference of about 3.30 hours. How can I resolve this? Where should I make the changes to adjust the server time correctly? Ok nevermind this one, I got it. <?php $timezone = "Asia/Calcutta"; if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone); echo date('d-m-Y H:i:s'); ?> Next I'll do the time calculations. Thanks all !
-
Hi guys, Thanks for the reply. I agree with cyber robot about the users who maybe able to cheat by changing the system clock so i prefer to use the server time instead. I am sure there would be ways in php, & yes I want to use only php and not java script ( having spent like 4 months to get the hang of php I don't wanna digress into javascript - nothing against javascript otherwise !! ), to make adjustments for the local time of the user. So can you or anyone suggest how i can do this in php. I need the code for time bcos i find the timestamp and conversions a lil tuff to program, there being so many ways to do a thing like this. I know it has to be sth like as is suggested by denno020: In terms of php $lastLogout = date("Y-m-d H:i:s"); if (task over) {$nextValidLogin = date(Y-m-d 24:00:00);} $diff = $nextValidLogin - $LastLogout; I hope I am correct and if I am then please some Guru may help me code this. Thanksssssss !
-
Hi all code Gurus I am writing a small user login routine. It checks when a user has logged in and finished a task. The user can login multiple times before the task is over. However once its over the user can login only the next day. That is only once a new day begins. But when the user tries to login again after the task is over, it needs to tell the user after how many hours and minutes the user may login again. I am storing the login time as datetime formatted (Y-m-d H:i:s). So suppose the user logged in today at 4.00 PM and finished the task , the user can then login after say 00.01 AM or after its 1 minutes past the new day. Since that time, if the user logs in again, he / she needs to be told after how much time the new login can occur. Please can someone help me with this. Thanks.
-
Hi guys and let me say this that i desperately need help on this seemingly no problem at all !! Ya so I am back again with another head swirler, at least for me. Needless to say I have been trying to figure it out for 2 days now and I was sure I cud do it without help but guess it was I was totally wrong & this is proving to be a most sly problem, one that refused to budge. So i have a Flash layer called TIMER where I have the code to display the timer and this layer also processes the time code where it uses variables like myMinute and mySeconds to hold minutes and seconds. It uses these two to store the time and then uses these to find the time elased till a BUTTON is pressed. This BUTTON triggers the handler (onPress()) which has a function say send_values() to create a set of values to send to the php. The function send_values() is described / written in the Actions Layer. Inside this layer, the two variables mySeconds and myMinutes are used to send the time to php using a variable lv1.time_in_seconds = myMinites*60+mySeconds; like this lv1.send(path+"data.php", "_blank", POST" ). ======= DEFINED IN FLASH======== var mysec:Number=mySeconds; // 20 var mymin:Number=myMinute; // 2 var vTimNsec=mymin*60+mysec; // 140 ========= SENT TO PHP =========== lv1.v_time_in_seconds = mysec; lv1.v_sums_correct = mymin; lv1.v_delay_digit_ms = vTimNsec; If I run this in the Flash (2.0) IDE and trace the values (DEFINED IN FLASH) OR display the values in a dynamic text box, I am shown the correct values. Then I send these values to PHP thru the array lv1 using the command lv1.send(path+"data.php", "_blank", POST" ); Now if i run this from a localhost with the flash embedded in the HTML file I get values vis_sum_corr = undefined // This is mymin vis_sum_tme = undefined // This is mysec vis_dig_dely = NaN // This is (mymin*60+mysec) Ok another thing that I did was that i checked the values of the variables in Flash with isNaN function and it gave me FALSE !! So the values displayed in Flash are displayed absolutely correct and the moment I send them to PHP they are changed to undefined and NaN. Has me totally zapped. Ok another thing that i checked. If i replace the variable values by numeric constants as below, ======= DEFINED IN FLASH======== var mysec:Number= 20; var mymin:Number= 2; var vTimNsec= 140; and send these to PHP, IT DISPLAYS THE CORRECT VALUES !!!!!!!!!! Can someone please guide me what is going on here and what could be going wrong. I have gone nuts trying. Desperately need some gurus to sort this out. Please help !!! Thanks all.
-
Hi guys back again with another head swirler, at least for me. Needless to say I have been trying to figure it out for 2 days now. And I was sure I cud do it without help but guess it was a very sly one who refused to budge. So i have a Flash layer called TIMER where I have the code to display the timer and this layer also processes the time code where it uses variables like myMinute and mySeconds. It uses these two to store the time and then uses these to find the time elased till a BUTTON is pressed. This button triggers the handler (onPress()) which has a function say send_values() to create a set of values to send to the php. The function send_values() is described / written in the Actions Layer. Inside this layer, the two variables mySeconds and myMinutes are used to send the time to php using a variable lv1.time_in_seconds = myMinites*60+mySeconds; like this lv1.send(path+"data.php", "_blank", POST" ). ======= DEFINED IN FLASH======== var mysec:Number=mySeconds; var mymin:Number=myMinute; var vTimNsec=mymin*60+mysec; ========= SENT TO PHP =========== lv1.v_sums_correct = mymin; lv1.v_time_in_seconds = mysec; lv1.v_delay_digit_ms = vTimNsec; If I run this in the Flash (2.0) IDE and trace the values OR display the values in a dynamic text box, I am shown the correct values. BUT if i run this from a localhost with the flash embedded in the HTML file I get values vis_sum_corr = undefined // This is mymin vis_sum_tme = undefined // This is mysec vis_dig_dely = NaN // This is (mymin*60+mysec) So the values displayed in Flash are displayed absolutely correct and the moment I send them to PHP they are changed to undefined and NaN. Can someone please guide me what could be wrong here. I have gone nuts trying. Desperately need some gurus to sort this out. Thanks all.
-
Hi Mac, I got it working. Since I am using Flash 2.0 its publishing the swf file and things is very confusing. The issue lay with the path. Once i got that correct ( its different for flash IDE and as an HTML invoked by localhost, it worked. Thanks loads since you had that in mind and you gave that pointer to me. Grateful and Thanks again.
-
hmmm ! well thats where i came from to where I am now. This code was a part of a larger program where the flash was embedded in the html/php. I was facing this issue there ( in the embedded movie page) so i created this separate bit of code to find the problem in the actual program. But since you ask I'll try this now. It wont take any time since flash creates the HTML too. So here i go to flash and will revert the results. OK so like in the actual code movie this movie also returns the absolute same result. The output is the variable $db_val1"; As you can see flash / HTML outputs the variable wid the ending quotes and the semi-colon, whose value it should actually be outputting which in my case should be 4 since thats the value I have sent to the code. The lines which outputs the flash / HTML are these :- lv1.sendAndLoad(path+"testdata.php",lvIn1,"POST"); // sends data values of lv1 variabless and GETS lvIn1 value /////////// for display on a webpage (_blank) /////////////////// lvIn1.onLoad = function(success){ if(success){ w_WS = lvIn1.db_w_var1; w_WT = lvIn1.db_w_var2; w_ST = lvIn1.db_w_var3; w_end = lvIn1.db_w_end; written_data = " WT = "+w_WT; } where written_data is a variable attached to a dynamic textbox. and thats where the value is displayed. Can you detect any problem wid this code here ? Syntax or logic ?? I don't think so but still just in case. Another interesting observation is that if i change on line 34 34. $db_val1=$db_val[0]; to $db_val1=4; the result is still the same !! i.e. $db_val1"; and if I force the value on line 52 as below echo "&db_w_var1=4"; i.e. equate the value to 4 the out put is 4"; !! Isn't that strange ? If that is any help in providing a clue to this one. Thanks again. Please help me solve this.