-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
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.
-
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.
-
Show us your new line of code then
-
PHP Notice: Undefined index: data in.. repeated log errors
ginerjm replied to myphp's topic in PHP Coding Help
And you should show us the exact line of code that you are adding as well as where you put it. -
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?
-
Guess I have some work to do.....
-
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?
-
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?
-
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
-
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.
-
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.
-
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.
-
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...
-
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.
-
How about showing us the code? That link you gave - what is it?
-
Help with what? You didn't specify what part of this (too much) code is giving you difficulty
-
Do you get any error message? Do you have php error checking enabled?
-
Yes! Definitely learn to use PDO. So much cleaner and easier to implement.
-
He gave me a good enough example to follow though....
-
I have a feeling that the OP has moved on..... Maybe to a course in how to write English
-
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
-
Set style.css in config.php - not pulling through css
ginerjm replied to WAMFT1's topic in PHP Coding Help
Which contains some php code that I'd like know what it looks like.... -
Set style.css in config.php - not pulling through css
ginerjm replied to WAMFT1's topic in PHP Coding Help
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.