Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. That is not the code that I posted for you to try out.
  2. So Dealmightera: Is this no longer "urgent" as you said in your opening post? Cause if it is I have to wonder why you keep disappearing. You have my attention - but you are doing your best to lose it.
  3. Which my last post is doing for you.....
  4. Huh? Take the code I gave you and put in place of the code you are attempting to use. And then try it. If it still fails, post it all
  5. And since there is only one fetch that must be the line. Try doing it my way. If you were able to read thru that post.
  6. Can you not read english? I asked for the code pertaining to this error and you sent me nothing. Sounds like the query did not run or else your code is broken. If this is the problem area: $query = "SELECT t.transactioncode AS tCode, c.transactioncode AS cCode FROM tsc AS t LEFT JOIN Candidates AS c USING (transactioncode) WHERE transactioncode = ?" $stmt = $conn->prepare($query)->execute([$tcode]); $result = $stmt->fetch(); I suggest (especially for a noob): $query = "SELECT t.transactioncode AS tCode, c.transactioncode AS cCode FROM tsc AS t LEFT JOIN Candidates AS c USING (transactioncode) WHERE transactioncode = :trancd" $parms = array(':trancd'=>$tcode); if(!$stmt = $conn->prepare($query)) { echo "Error doing prepare - Aborting"; exit(); } else { if (!$stmt->execute($parms)) { echo "Error running query - query was<br>$query<br>"; exit(); } } // process results now if (!$result = $stmt->fetch()) ... ... Makes for much clearer reading.
  7. This query seems strange to me: SELECT t.transactioncode AS tCode, c.transactioncode AS cCode FROM tsc AS t LEFT JOIN Candidates AS c USING (transactioncode) WHERE transactioncode = ?" You are selecting 2 values that are the same and nothing else. I picture a set of records for your chosen code that are nothing but that and nothing of value.
  8. Show us the code around that error line as well as the FULL EXACT error messge
  9. I told you several things that were wrong. Look them up in the manual to learn how to code them correctly.
  10. First of all - you have TWO TABLES, not 2 dbs. Next - you run the query but you never check if it ran or not nor do you check if any rows were returned so the fetch may very well fail. Then - you do a second query from your 2nd table but why use a second copy of the user-entry 'transactioncode'? You already have the value in the $trr var so why do you need $trr1? After the queries are run (hopefully) you are doing a rather fruitless test if the 2 results match the user provided code which if you did received results from your queries is unnecessary. But since you didn't do any checks on those results you can't be sure of. PHP - when testing if something is "equal to" something else you must use == not just =. You elseif if flawed. Lastly (cause that is far as I read) you are referencing a variable $fetch. Where is that defined?
  11. Then you need to read up on how a RDBMS is supposed to work. Database design is important and crucial to creating a proper and helpful database. Definitely do some reading on that before embarking on programming to use it. And if you don't know what RDBMS means, you need to read up on that term.
  12. You are correct. "one table won't do". Something is missing in your sql class teachings. The design you have come up with is so wrong and so un-like what one is supposed to learn about in a class for sql.
  13. It gives you the full path to the directory you are running it from. No domain. But you have probably figured that out already
  14. And what does the manual for this 'Buckaroo' tell you?
  15. The addition of the DIR just adds more to the total path you are seeking.
  16. What are you saying? Who is talking about 'error handling'? If you want to do some change to accomodate an additional update to a record it sounds to me like the update function needs a change to handle that.
  17. And now you make it clear.
  18. And - why can't the first be also sent to you with all the info that it has? Just a thought.
  19. Why 2 emails? Why not just add yourself as a CC or even a BCC?
  20. If you do re-write it and still have errors please post it to here as TEXT and not a picture of text. That way we can work with it.
  21. I think you would need to modify the Update function to achieve your wish. What you are showing us is the setup steps only. The Update function would need a change to accept a new parameter and a change to the query that gets run by Update to accomodate a new setup field. Have at it!
  22. Way too many errors! This line: $id = isset($_SESSION['id']); Do you know what it does? And then this line: if ($row['email'] === $email && $row['password'] === $pass) { $_SESSION['id'] = $row['id']; .... .... .... Do you know what is wrong with it? Add this to the beginning of your script: error_reporting(E_ALL); ini_set('display_errors', '1'); It will enable error reporting. Set it so '0' once you are done developing any script but not until.
  23. Add this to the top of your script: <?php error_reporting(E_ALL); ini_set('display_errors', '1'); echo "In my script at line: ".__LINE__."<br>"; Let's see if you get that far at least. If not then you are not showing us enough of your code. PLEASE do not post an 'image' or your code - only real code that we can easily read and copy to our own editors to work with if necessary.
  24. Why should we click on something that we have no idea what it is?
×
×
  • 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.