Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Use your date value as the key value of your array and assign the project id as the value of each item in the array $dates_array['17-02-14'] = 15 $dates_array['18-02-14'] = 15 Pass the id to the function and change the function from: $datesArray[] = date($format, strtotime("{$startDate} + {$day} days")); to: $k = date($format, strtotime("{$startDate} + {$day} days")); $dates_array[$k] = $proj_id; where $proj_id is passed in as a param
  2. The join was probably doing everything correctly. Your output scheme is probably to blame. You need to add some code to recognize when a new record is the same (key?) as the last one, and in that case only output the image from that record. When the new record has a new key (diff from the last key), only then do you display all the data from the new record.
  3. can you post the code neatly in the proper tags? Many of us are hesitant to click on links to other (possibly 'bad') sites. That's why there are code tags implemented here.
  4. #1 - pagination on a mobile site is no different than a non-mobile one. #2 - try googling it and getting some code together and then if you have a problem, show it to the forum.
  5. Why don't you clean up that code, read the forum instructions and post your code properly afterwards so that we can read what you want us to amend for you?
  6. Just because you are now using PDO doesn't mean the basic principles don't still apply. $qstmt = $conn->prepare('SELECT * FROM customers'); $qstmt->execute(); while ($row = $qstmt->fetch(PDO::FETCH_ASSOC)) { $email = $row['email']; $testname = $row['name']; $testlastname = $row['lastname']; echo "$testname has a last name of $testlastname and an email of $email<br>"; } Note that you don't need to use prepare here since you don't have any arguments to your query.
  7. Instead of trying to write such a complex class, why not just use prepared statements? Trying to build a query statement for any and all circumstances would be an impossible task. Besides, the time it takes you write individual queries would never add up to the time it is going to take you to perfect such a thing (if even possible).
  8. I'm going to step in here to give you a couple of quick hints in case Jacques1 is offline. In the following lines: $num_items = mysql_result($result, 0, 'num_items'); and $num_comments = mysql_result($comment_result, 0, 'num_comments'); The variable named as the first argument of the MySQL_result call is the variable that was assigned the results of a query. You need to review the code preceding the error lines to check what variable name received the results for that specific query Look for a line such as : $result_var_name = mysqli_query(......); and be sure to match that variable name with the one in the fetch statement to correct those error messages, as below: list($num_comments) = $result_var_name->fetch_row();
  9. Do these users signin? Create a table for users that records their id, the date and a counter. If the date doesn't match today's date, start over with the counter and set the date to today. No - you don't need to translate my echos
  10. How about doing some research on databases and tables and sql? Then some reading up on what is important to do when writing an authentication script. Maybe a good book on php and MySQL would come in handy. There are many ways to learn these things. Do some research and see which ones resonate with you and your learning abilities.
  11. Generally one uses an input type of radio buttons when their is to be only one allowed response. Checkboxes are for multiple responses or for separate and distinct ones.
  12. Generally, you have a database table created to hold the pertinent items according to your needs. Obviously a uid and pswd, with the pswd encrypted using the best one you can access on your system/host. A secure application to request and authenticate your users login info is a must. A token that lets the rest of your application know whether or not the user is allowed to proceed is the ultimate results of the logon process which can be a session var or a cookie. All of this will require you learning more than a small amount of many things.
  13. You need to design a form, or write a query to get your data first?
  14. How are you making this report? Are you just using echo to output line after line after line? Are you using FPDF? Are you outputting an html table? Need more info and maybe some SMALL snippet of relevant code. Don't know what those "things" you attached are, but I can't see them. Did you review your post to see if they were visible to you?
  15. JYAP721 - Whatever made you think that you should be tinkering with all these things? Are you Trying to break your system?
  16. People here usually help people out with their code. How about showing us line 502 or the code directly around it?
  17. Try starting your session first. Why do you want to make it a result of some condition? Just start it!
  18. Your first statement implies that the value comes from a url query string while your second line merely sets a local variable to a value. These are in no way connected.
  19. How about showing us the actual code you used, instead of just the function name you used?
  20. IMHO if you have a secure login page (with all that the word 'secure' entails) already working, then adding another column to the table behind the login is the way to go. It gives you the freedom to use it for new features that may be added later as well as the ability to add that 'extra' admin person without having to do any coding. Simply checking the user's login data for the correct 'security level' obtained as part of the login process gives you the ability to control access to any part of your appl.
  21. May I ask "What is a shortcode?" without sounding stupid?
  22. I know how to use js to close browser windows and in fact I can close IE completely but I can't seem to do it with Safari on an iphone. It closes the current app window but then either switches to another app or opens a blank window and waits for me to hit the home button. Can one use JS to close the entire browser on an iphone?
×
×
  • 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.