Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Place your test logic inside the loop - if there is one. You should test the # of rows returned and if it is not 1, you have a problem. If it is only 1, then you can simply do a single fetch and use the returned value in your remaining logic.
  2. Here is another way of writing this $User = current_user(); // I assume this 'current_user function is something you wrote $sql = 'SELECT fk_usertypes_id FROM users WHERE email=:User'; $statement = db()->prepare($sql); $parms = array('User'=>$User); if (!$statement->execute($parms)) { echo "Query did not run"; exit(); } // You probably don't need a loop here, but here you go while($row = $statement->fetch(PDO::FETCH_ASSOC)) { echo "UserType " . $row['fk_usertypes_id'] . '</br>'; } // this code makes no sense since you are not in the loop here. /* if ($bob == 1) echo "Hello 1"; else echo "Hello 2"; */ echo "<p><a href='index.php'>Home</a></p>"; view('footer'); // I HAVE NO IDEA WHAT "view" IS SUPPOSED TO DO FOR YOU Made some changes to your use of PDO and the way your query results are being processed. Of course, as already mentioned, you probably only have one results row since the email should be unique (perhaps). And I'm assuming that 'bob' is representing the sole result value, the usertype id, hence I left it out.
  3. Show us your new line of code then
  4. And you should show us the exact line of code that you are adding as well as where you put it.
  5. Not familiar with Bootstrap but since all I see here is an attempt to use a CSS(?) class to do your formatting. If that is what you are using, how about showing us the CSS?
  6. I realize that you are used to using free things but in this case if you make the effort to teach yourself how to implement PDO for a database interface you will learn so much more than you currently know. No - it's not gonna be free but it will be worth the effort.
  7. Yes - I know I am out of date and it is something I should have handled long ago. That said - Is my question valid? The PASSWORD function is no longer valid?
  8. Suddenly my old php code is having a problem when I try to run a mysql query that still uses the password function. I know I am way out of date but this code was working fine until the last week or so. Do I have some coding tasks ahead of me?
  9. A good way of thinking (in the coding world) is to leave a space between things to avoid any confusion as to where the previous 'thing' ends and the next 'thing' begins. So joining the php start tag and brace (<?php}) presents some confusion which you can avoid by using a simple space char
  10. This would be easier if you posted the specific area of your code that is giving you this problem. Giving us a link is not the way to do it. And NOT the whole code either.
  11. As I said - we really don't need to see the html and non-php stuff. Show where the line 209 of the error message is and the lines leading up to that error. Please.
  12. $row = mysqli_fetch_assoc()($query_result); Have you read any documentation???? The above statement is so wrong. Read the manual.
  13. The PHP mail() function only returns a boolean based upon if the command was setup (?) properly. If you need a better response you might find more help using PHPMailer which is pretty easy to install and use.
  14. Perhaps if we do see the code we can see how he is handling it. But I'm thinking that is not going to happen...
  15. Well - I clicked on it and all I see are filenames. Clicking on them does nothing. We like to actually SEE code that you want us to examine. Especially the part the is heart of the problem and not all the rest of it. That usually means the php part and not the css or html part. So please copy and paste in into your next response (using the <> icon to place into a block by itself) and that will give us all a chance to help you.
  16. How about showing us the code? That link you gave - what is it?
  17. Help with what? You didn't specify what part of this (too much) code is giving you difficulty
  18. Do you get any error message? Do you have php error checking enabled?
  19. Yes! Definitely learn to use PDO. So much cleaner and easier to implement.
  20. He gave me a good enough example to follow though....
  21. I have a feeling that the OP has moved on..... Maybe to a course in how to write English
  22. You want to 'build' a flat file or you want to 'edit' a flat file and what do you propose to use for this a simple text editor that you already have on your pc or you want to write a php script to do this what have you written so far that would help to help you out and what does 'tiny_mce or Quill' mean
  23. Which contains some php code that I'd like know what it looks like....
  24. Yes - I'd be curious what your html actually looks like in your browser. How about cutting and pasting it into a post here. Just the part we're talking about not the whole page.
×
×
  • 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.