Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. One usually posts code here rather than provide a link to a possibly infected site. One also turns on error checking in their php to see any potential errors. See my signature.
  2. Is this homework? NO help from me if it is. And if you are trying to learn, why not try to write your own code and actually LEARN something before copying somebody's object-oriented code?
  3. Also - this line is not what (I think) you intend it to be: $filetype = '*.html'; $dirname = substr('$filetype'); $dirname is going to contain exactly: $filetype It is NOT going to contain anything with *.html (or any part of it). Substr requires a start value and you left it out. If you had turned on error checking (As You Should in development) you would be seeing a warning.
  4. I'm sure that this: store a basic 20 slot 0 iteration makes a ton of sense to you. Not to me. My one comment on something that I do understand - you have a system that stores multiple pieces of the same discrete data item into one field? Well if it works it works, but it is certainly not a RDBMS. Every time you read something you have to break it down into useable values and when you store it you have to reverse that process. Horrible design.
  5. Action field? If you have a submit button with an event action too, then yes, the event response will occur as well as the form submission.
  6. Why not an onclick event on the submit button that triggers a js function that outputs your message?
  7. Have you EVER looked at the manual to solve any of your mysqli usage problems? $num_rows does not exist. It is not a local php variable. It is a property of a mysqli result WHICH if you had ever looked at the manual you would see you LEFT out of your code. Change this: $db->query($sql); to this: $results = $db->query($sql); NOW you have a result set to play with which you did not before Now change this: if ($db->num_rows > 0) { to this: if ($result->num_rows > 0) { Note the dollar sign. These would have been very clear to you if you EVER read the manual. PS - for the future - when you post an actual error message it would be nice to point out the line that it is referencing in the message. This one was easy but it won't always be that way.
  8. What are you getting back from your urls? Have you looked?
  9. Not a 'basic' kind of thing, but still not that hard to do. Need to do some googling on ajax requests and try to understand how it works. Basically - your js code is triggered by the onchange (or an onkey* event) event of your input field. That means as the user types something your js code executes immediately and prepares an http request that is sent to the server as a totally separated task. That task is going to run a php script to do your bidding and return you something - whatever you want. Your js code retrieves the response and then handles it - probably by putting something into the html of your screen. If you have a slow connection to your server this will be problematic. Question - are the possibilities part of a limited (ie, small) set that you know beforehand? If so, you could build an array for your js code to use instead of using ajax to go back to the server on every keystroke.
  10. CyberRobot is not alone. What the heck are you talking about?
  11. Whatever. I'm confused and can't make sense from your writings.
  12. How did the csv'ed data get INTO that database? It needs to stop. Then you won't have this problem.
  13. I tried to point you in the right direction. The thought of creating a 'key' is not going to work for you I don't believe. Think of querying for concepts in your data, not 'keys'. Define how the data has to look for a given situation and use that as your 'key' if you will. Closed - when a time slot is assigned Open - when a time slot is undefined or assignment field is empty As for partial and full usage - is this really something that will occur? Can you possibly get "full utilization" of time slots when you book them back to back for different users? Have you thoug about how the actual use of your resource will happen? Think about a meeting room. Someone books it for one hour. Yet you have to have it available for a certain amount of time prior to that hour for it to fill up, and for some time afterwards for it to empty and for it to be re-fitted for the next user (cleaning?). So - you have to actually book a time slot for extra time. Do you really want to be booking partial time slots?
  14. Why does the url 'get lowercased'? Something you are doing elsewhere? If you have data stored in one way why would you not use that data correctly (as is) to build your URL? Or did you not build your file/folder structure using the same exact values as the data? You do realize that you can build your anchor/links using a modified version of the data for the 'displayed' portion and still use the original stored version for the href portion? This has got to work unless you did alter how you used the data previously and now can't make it match. As for the 'foreach' method of altering the case and not getting permanent results - try using & on your foreach arguments. It's in the manual.
  15. May I just ad my two cents here? BoneHead Move. You have data. You are using a database. Use It Properly. A csv string/file inside a db table? Now I've heard of every stupid thing that a newbie can possibly do wrong. In my previous incarnation a programmer working for me would never be allowed to do this (let alone think of doing it!) or he wouldn't work for me very much longer. You are getting good advice from people who know what they are talking about. You came here just for that, didn't you? LISTEN TO THEM! You're driving your car down a one-way street in the wrong direction. Turn around now and stop debating them.
  16. The key to this whole process is having sufficient data stored on each "day" so that you can write a query that determines the things you wish to find out about that specific "day". So - have you that data? You say you are trying to manage "time slots", therefore I assume that you table contains records that identify each time slot for use. Is every possible time slot created in the table before it is allotted, or do you only create a record when someone books it? That would be one way to identify availability. Once a slot is booked do you treat that specific time slot as 'fully booked' and therefore unavailable to anyone else? Again - that answers the availability question. With my two examples (very small help) I'm hoping that you are inspired to think about your problem in a more logical way and come up with more ideas on solving your needs.
  17. Nothing new there re: PDO. All those points are addressed in the manual I believe.
  18. You decide. You could use the data's saved date/time value and send the latest one out on the web page as a hidden field in your form. Or you could just send the current date/time. When the web page is submitted/posted back to your script you get that hidden value and use it as your compare value for when you build the new/refreshed page.
  19. Only thing missing now is how to retrieve the results.
  20. You will need to output your results using some html and css to do your highlighting. From what you wrote I'm guessing you are just echo'ing some query results. Try putting them into an html table or in an html list and use css to produce the highlighting. echo "<table>"; while($row = $pdo->fetch()) { if ($row['datefld'] > $highlight_date) $classname = 'hilight'; else $classname = 'normal'; echo "<tr class='$classname'><td>{$row['field1']}</td><td>{$row['field2']}</td><td>{$row['field3']}</td></tr>"; } echo "</table>"; You would need to set the value of the $highlight_date field based on something and write a couple of css classes to achieve your highlight or normal effects.
  21. It works anyway you want it to. How is the refresh done? By the user clicking something that triggers a POST? You can put something on the page to mark the last shown record and then highlight ones that succeed that on your next page build. You can use a datetime value for this, or a record id value. It's really not an exact science - it's just some algorithm that you yourself make up and follow. The highlight is the easy part using css. It's the recognizing that you will have to work out for yourself.
  22. 1 - I'm surprised that during your build of this site you didn't run across ANY warnings about this interface being deprecated. 2 - Since you apparently didn't use the official PHP manual to build your site, I suggest that you begin LEARNING mysqli by reading the manual and using the examples you will find there. While mysqli is a bit different from the old MySQL interface it is not going to bring tears to your eyes. May I suggest though that you get permission to use PDO instead? I find it to be much simpler and it provides the ability to connect to non-MySQL dbs as well.
×
×
  • 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.