Jump to content

ginerjm

Members
  • Content Count

    5,172
  • Joined

  • Last visited

  • Days Won

    68

Everything posted by ginerjm

  1. Again - point out to us which line is failing you or explain what you are doing and not understanding. 25 words or less please. That will make more sense. BTW - did you understand what I told you last?
  2. What people are telling you is to NOT write your code like this and to learn how it SHOULD be done. Ignoring that - what is the problem now? YOu can't find the right value? Are you allowing for case being incorrect? Or have you researched how to make a proper compar to allow for different cases? Research, research, research - something a programmer has to do.
  3. So have you got your answer yet from Philw's post?
  4. Probably will need a good php reference guide to help you learn.
  5. I"m confused. Do you want to find the records with a specific id num or the ones that are students? And - a table with named "user_info" with a column named "userid" kind of implies that there is only one row that matches. Hmmm.....
  6. I"m guessing you did a little research to look up that function. Also called "implode". But you probably found that out too. Good work!
  7. Yes - forums (including this one) DO help people. But not with all of their tasks. Forums like this one help you address your code. Help you correct it or debug it or help you amend your solution. We are not here to just plain write it for you. We are here for people who are having difficulty but that means showing us the difficulty.
  8. And you are asking the PHP forum to do what for you?
  9. The message is correct. The problem is in the query. If you did it the way I said to do previously, you echo out the query itself with your error message and look at it. YOu have some bad logic in that query. Do it this way: $q = "SELECT cat_id, subcat_id, subcategory_title, subcategory_desc FROM categories c, subcategories s WHERE ($parent_id = categories.cat_id) AND ($parent_id = subcategories.parent_id"); $select = mysqli_query($con, $q); if (!$select) { echo "Error running query - $q<br>", mysqli_error($con); exit(); } Note how I wrote the query to make it more readable. And how I saved the query itself so that it can be echo-ed out to review. Your problem may very well be that you have two tables but you don't distinguish which selections are from which table. If you have fields with the same name in both tables the query engine doesn't know which one you want. Note how I assigned aliases in the query to the table names. Add those aliases to your field names by doing "c.cat_id" or "s.cat_id" depending which table the field comes from. And you are missing a closing paren.
  10. Add some checking in your code to be sure that the query was run successfully. Something like: // check if there was an error running the query if (!$select) { echo "Error running query : " . mysqli_error($con); exit(); } I'll let you figure out where to place this block of code This will print out a message if the query is failing you. Or if the $con did not get properly made prior to that. Suggestion. Always assign your query statement to a variable and then use the variable in the query call. That way you can have your error handling code print out the query for your review. As you have it now you can't do that.
  11. ginerjm

    php insert

    When you figure out where your "name" field went to, I highly suggest you modify some of your db field names. Using "date" and "time" is not good practice. NAME the field, don't just say date or time. And are all of these fields necessary on that one record? Should there be some division of them amongst a couple of tables to make a proper RDBMS?
  12. Since you're not showing us any code, let's play a guessing game. How do you know when they have paid on Paypal? Are you waiting for a message from PP telling you such? Or is there some connection you are making with code you have written that will give you back a response? This is fun!
  13. YOu posted an awful lot of c.... The problem is on LINE 20. Look at it and then figure out why your db connection or your query is failing you. That is the problem. Do you have error checking turned on?
  14. Are you going to register this copyright too?
  15. First change the while to an if. Then put all that at the top of your script and only execute it if your detect that the POST method has been submitted. If not, that's when you fall down to output the html part.
  16. It is not really php code. It is echo's of html code and no real logic - none of which fits your topic title.
  17. I still don't see any php code. Getting bored. Good bye
  18. PUT your php at the start. Save the html for the end. Your php code embedded in the options is wrong the "choice" will be Pi or econs, not Option1 or 2 or 3. Basically , the value value. You will not have a $_GET value. Your form is using POST
  19. I can't imagine what your code looks like.
  20. Where is the input value for the user's number? And where is the php code that is processing your html ?
  21. I would write a script that starts by testing if the form is submitted. If it has been submitted I process the inputs setting php vars with their values. Once done, I can now send back the html page with or without the data values that I extracted from $_POST along with any other info. I keep the output of the html code at the end of my script and just fall into it when ready. (Actually I bury my html page code all in a php function that does my entire output of the html to make it easy to isolate. Any dynamic html code (an html table of results say) I pass into it with an argument in the function header and place the arg where it fits in the body of the html.)
  22. Looking at your last set of code I see you will still have the same problem with the lockedcard part. You need to use isset on it before trying to see if it has the value you are looking for. And - no - I don't help someone if I don't know what I am doing. I politely say 'No - I can't help you.' and leave it at that.
  23. If you have no knowledge of Ajax I'd recommend the easy way. Make sure you have php vars setup in your html input tags. That way when your script grabs the data from there those values can be sent back out once the script is done and the screen will look pretty much the same, although I would imagine you would add some kind of message saying success or failure. PS - I think you may have a table design problem. You are probably going to record these bookmarks for an item, hence the itemid (don't use mixed-case!). But don't store the username on the same table as these records. Create a users table with a userid and a username and whatever else you want. Then create a bookmarks table with the itemid and the bookmark value and the userid only. That's how a true RDBMS is designed.
  24. So why are you doing this? Do you also pull apart your car's engine to work on it without the knowledge? Programming is not easy especially if you don't begin at the beginning.
×
×
  • 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.