Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. You can't recognize the problem? How about you use a $_SESSION var even tho you never started the session?
  2. Next time try reversing your use of quotes. Since php recognized any php var that is wrapped in double quotes on the outer side you could have started the query statement with a " and then not have to concatenate all of your vars in the values. Ex. $q = "insert into table (field1, field2, field3) values ('$value1', '$value2', '$value3')"; Much simpler to code and read and works the same as your more complex string.
  3. Huh? You don't make much sense to me. And posting a stream of code such as you did is not the way to encourage help. Good coders write their code in neat formats to make it easy to spot things, to make it easy to read and understand. Perhaps a better composed description of WTH you are trying to do would help too.
  4. Why not post your amended query statement here? And maybe the lines just before and after?
  5. 1 - try turning on php error checking at the very top of your scripts. 2 - do some debugging. At the point that you THINK you have prepared the data to be inserted into the word template, dump it out to the screen and check it. If your script is failing before that, insert some echos at various points leading up to that to be sure that you are getting that var. This is what programmers do.
  6. You are using php to setup error handling messages in JS. Why? You do realize that you can't have php and JS interact in real time? If you want a real time error message then stick only with the JS code to check the values onsubmit. If you don't want real time, then stick to only php to edit the posted values and send the screen and data back to the user. Can't have it both ways.
  7. Also- should you have a need to post more code in the future, please try and format it to make it easier to read and comprehend. Your first post is pretty bad reading.
  8. Besides what others are telling you has to be fixed, what are you seeing wrong with your code? You don't check anything so it can't tell you if something is wrong. AND - since you simply make a connection and run a query, what are you missing? Your code as written will not tell you anything. Do you know what a function is?
  9. If 1 and 99 and 1000 and 2000 all are the same field and are NUMERIC (not text) that will be difficult.
  10. Can you manually send an email to the problem address(es), ie, using Outlook or something similar?
  11. To give you the details. 1 - get a user id and password from the user 2 - encrypt the password and save the userid and the encrypted password in the users table. When checking a user's login attempt: 1 - get the user's id and password entries 2 - encrypt the password value the exact same way as you did when you stored it 3 - do a query on the table to get the record that matches both the user id and the encrypted password entry 4 - if the query returns exactly 1 record - the user logged in correctly. If not - send them back to login again. As said by Maxxd - you don't return the password in the query, nor do you get it and save it anywhere. The password is not needed once you verify that it was provided correctly. If you need to remember that a user is logged in you create a token that indicates that to your application, such as a $_SESSION var or a cookie but in no way do you store sensitive information in either place.
  12. You need to study on how to build a properly structured relational database. Some ideas you should think about are what attributes you want to link to what data. Such as the name of the page from where an item came from should be stored with that item, or linked to it along with other data directly linked to that item.
  13. Yes - you have many silly little errors. Turn on php error checking (as in my signature) and fix the little typos and see what happens.
  14. The error is telling you that whatever you are attaching to that call to read() is NOT an object or not an object of the correct type. Ex. - If you have $my_obj->read(), it means that $my_obj is not an object.
  15. How about "DAY(date) as date_dd" and "MONTH(date) as date_mm" and then use date_dd and date_mm as your indices into $row? AND definitely change your code to stop using MySQL_* functions. They are going out of PHP soon.
  16. Have you read anything in the php manual that sounds like it might help?
  17. Upon further review: YOu are doing two query calls. You are trying to grab data before you do the fetch, which I finally noticed. - do the query call (just once!) - check if it ran - check if there are rows If all this works: - loop thru the rows and grab the items from the $row and echo them
  18. You're not doing a fetch call. query check fetch process fetched row repeat fetch
  19. Have you checked the manual yet? Read thru the Imap functions.
  20. Not the way one is supposed to design a database. You have people - persons as you call them. They each have some qualities - attributes in db lingo - which consist of things like: name gender address? title? phone? and other things. These all belong in one table unless you find that you have multiples of them, such as two addresses. (People often have multiple phone numbers but I like keeping them stored in the main table under unique names such as 'home','work','mobile' rather than using a second table. So - in your case - you should not be storing gender in a separate table. Especially since a person can only have one gender and it usually doesn't ever change.
  21. What do you need here? The message pointed you to the line. Look at your code and see what you are missing that the php interpreter is seeing. Undefined variable? You haven't yet used the variable but are trying to get a value from it. A non-wellformed numeric value? Whatever you THINK is a number is NOT. Fix your code.
  22. You're having another issue? With what? A variable? Is there a message with that problem? Give us a hand if you want our help.
  23. I dont' see these new lines in your previous code posting (which needs to be posted properly next time!). Have you changed things? And as QOC says - names need to match. Quick lesson: The name attributes of input elements are what you need to look for in your $_POST array upon receiving the submit from the client. That's the connection.
  24. So - I'm guessing that you didn't write this code yourself since you can't even be bothered to look up how to do what I suggested, since you state that you 'echo' statements aren't showing anything. Being new to PHP (or any language) means that you have to do some homework, some reading, some learning, some attempt to comprehend what you are trying to achieve. Not just post some code that you gleaned and can't figure out and ask for someone else to teach you. Make the effort!
  25. I suggested adding some echo statements to show you what the values you are using really are. Add a limit=1 to your query and work through the problem looking at what your code is producing and what it has to work with. That's how one debugs a problem.
×
×
  • 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.