Jump to content


  • Content Count

  • Joined

  • Last visited

Everything posted by 684425

  1. Following a tutorial on udemy, i tried to learn the very basics of mvc structure. I built the same project on my local server and it worked without giving me any error. but when i tried it on live server. its not working as it should. not showing any error. I tried to figure out the problem and found that for every page loading, it stops at the same line in my main.php file. <?php require($view); ?> starting from the above line. it stops. i came here to share my problem but i am unable to upload my files here. if there is a way to upload and share my files, please guide. zip file size of the whole project is 31.6 kb
  2. I have created a session array on one page and stored some values as $_SESSION['users'] = array( "id" => $row['id'], "fname" => $row['ufname'], "lname" => $row['ulname'] ); and then on another page I have some more values for the same session array "boss" => $row['bossid'], "tasks" => $row['tasks'], "timeframe" => $row['tframe'] I want to add these values into session array both keys and values. is there any way of doing this? Please help
  3. I have date stored in database in any of the given forms 2020-06-01, 2020-05-01 or 2019-04-01 I want to compare the old date with current date 2020-06-14 And the result should be in days. Any help please? PS: I want to do it on php side. but if its possible to do on database side (I am using myslq) please share both waysπŸ™‚
  4. Sir, I am following your advice. I have normalized my database and now I am working on app to remove errors that is why my reply is lateπŸ™‚
  5. SELECT tbl1.pay AS bpay, tbl2.grade AS t1, tbl3.grade AS t2, tbl4.grade AS t3, tbl5.hours1 AS d1, tbl6.hours2 AS d2, tbl7.hours3 AS d3 FROM employees AS tbl1 LEFT JOIN employees AS tbl2 ON tbl1.time1 = tbl2.id LEFT JOIN employees AS tbl3 ON tbl1.time2 = tbl3.id LEFT JOIN employees AS tbl4 ON tbl1.time3 = tbl4.id LEFT JOIN overtimes AS tbl5 ON tbl2.grade = tbl5.ranks LEFT JOIN overtimes AS tbl6 ON tbl3.grade = tbl6.ranks LEFT JOIN overtimes AS tbl7 ON tbl4.grade = tbl7.ranks WHERE tbl1.id = 67 The above query returns result including red highlighted values which I am trying to remove
  6. From tables shown in image, I am trying to run a query for employee 67 which return only one row containing id, pay from employee table and from overtime table i want to choose values from columns hours1, hours2, hours3 based on references mentioned in employees table. I have highlighted the values in both tables for which i want to run the query.
  7. I was not sure whether i should separate them or not, but after your advice i separated them πŸ™‚
  8. Sir, your query worked as expected but last day after posting my problem here i searched for the solution. From w3schools i found one example in SELF JOIN. SELECT A.fname AS yourname, B.fname AS yourbossname FROM employee A, employee B WHERE A.boss_id = B.id Not challenging your knowledge and your experience but just for increasing my knowledge. Do both LEFT JOIN and SELF JOIN are same in working or is there any difference in both? PS: if its up to you, which one you would like to prefer?πŸ™‚
  9. I have an employees table which stores id as auto increment values, names of employees and boss id chosen from the same table. I want to run a query which shows result as Hi Jane Doe, your BOSS is John Doe But it seems beyond my knowledge. Any help please? I have attached image of similar data
  10. Thank you for your help. With some modification, it works fine πŸ™‚
  11. In some countries 123456789 amount of currency of in general, it is counted as (if i am not wrong) one hundred twenty three million, four hundred fifty six thousand, seven hundred and eighty nine. Comma separated format is 123,456,789 But in some countries (like mine) the same amount is counted as twelve crore, thirty four lac, fifty six thousand seven hundred and eighty nine. Comma separated format is 12,34,56,789 As we people are used to the second format that is common here, the thousands separated format mostly confuses us in reading.
  12. In php number format function works like.... number_format("1000000",2); // 1,000,000.00 is there a way to format numbers like... 10,00,00,000 (from right. No decimal. First comma after 3 digits and then commas after every 2 digits)
  13. The code in attached file is not working for me. and i am failed to find any mistake. Anyone help me please. deletedept.php
  14. Plz check attached file. it does not give any error when letters are typed. new.html
  15. <input id="numb" type="number" /> <input type="submit" onclick="myFunction()" /> <p id="demo"></p> <script> function myFunction(){ var x = document.getElementById('numb').value; var regex=/^[1-9]+$/; if (x == ""){ document.getElementById('demo').innerHTML = "Input is Missing"; } else if (!x.match(regex)){ document.getElementById('demo').innerHTML = "Input Incorrect"; } else { document.getElementById('demo').innerHTML = "Input OK"; } } /* if (x == "") { document.getElementById('demo').innerHTML = "Input is Missing"; } else if (isNaN(x)) { document.getElementById('demo').innerHTML = "Input Incorrect"; } else { document.getElementById('demo').innerHTML = "Input OK"; } } */ </script> When input type is "text" it works fine. but when i change input type to "number" and then if i type letters or letters plus numbers. it says "input missing" How can i get correct output while using input type "number" ? Please guide. Thankyou.
  • 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.