Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Where is this updated code? I don't see it in your post.
  2. As the message says you can't output anything before your graph package does its output. You are sending the html for your page prior to the graph package calls, so that is your problem. However I'm not entirely sure since line 21 is NOT doing anything so it is a bit confusing. When you said "here is line 21" are we seeing the VERY beginning of the currently running script or a part of the whole thing?
  3. Are you showing us history.php or is the code above from some other script?
  4. The message has a line number in it - that is your problem line. Find the # and identify the line and then show us in the code where it is.
  5. Which you could have found out rather quickly by reading about the 'bindvalue' statement in the MANUAL It is simply amazing how so many would-be programming types visit forums with questions that are so easily answered with a little research (aka, reading!) in the most appropriate place, namely, the manual.
  6. What you should really learn from this is to ALWAYS DO ERROR CHECKING whenever you do something (as I say) 'external'. A call to your db server (a query!) is external so you should always do some bit of code that will verify that what you 'think' happened actually Did happen. A simple check on the query result var and display of MySQL_error would have solved this before you even made your first post here. Glad you solved it.
  7. Well, you'll never LEARN by just copying someone else's bad code. The sooner you start READING up on php and WRITING your own code the SMARTER you'll be. Good luck in your endeavors - and on this course, they will definitely be endeavors.
  8. Why are you playing with classes and inheritance at this stage in your PHP development? You have so many problems and apparently don't recognize proper syntax yet. Just stick to writing some decent code and grow into classes later on, otherwise you will only be re-writing them again and again as you FINALLY begin to catch on. 1 - where is $db defined? 2 - you set your pdo to retrieve assoc arrays but then you try and retrieve the data with numeric indices. 3 - you fetch your entire result set and store it into an array to then pass that array on to some method. Why? Much smarter functions available to you but you haven't realized that yet. Read the manual on 'fetchall'
  9. So - have you added the error checking and added code to check the results of your query call? If you re-run your code with those two things you should definitely see some error messages to help you. At this point - you query is so simple that there must be something wrong like an invalid column name or table name.
  10. How about skipping the sprintf calls to build your query and just create the string you need? Nothing magic about sprintf and it just complicates things. Then - echo out the query statement before you run it so we can what has been built. Be sure you have error checking turned on in your php and ALWAYS check the result of the query call to be sure it ran.
  11. On what are you basing your conclusion that there are no results? The bare echo of the count?
  12. Do you have error checking turned on? Do you have some more code preceding this code? (Basically, where is the code creating $conn?)
  13. Since you are learning here's a sample of code that IMHO is a much better way to develop. It makes for easier reading and debugging and for fewer typos when trying to enter/exit php mode constantly. The idea is to separate html and js from php and let the php vars bring the dynamic parts of the output into the html after being built somewhere else. // always turn on error checking during devl. error_reporting(E_ALL | E_STRICT | E_NOTICE); ini_set('display_errors', '1'); // GET the position of a letter that is in // your own name $name = "John"; $letter1 = "h"; // the function strpos returns a value which you weren't retrieving. $pos1 = strpos($name, $letter1); if ($pos1 !== false) $msg1 = "The letter '$letter1' is at position ".($pos1 +1); // Check for a false value of a letter that is not // in your own name and print out an error message $letter2 = "K"; if (strpos($name,$letter2) === false) { $msg2 = "Sorry - no '$letter2' in '$name'."; } // Now use the assigned vars above in your html and avoid // having to mix php with html. // The PHP 'heredocs' operand (?) is great for outputting lots of html mixed with php vars. Check it out in the manual $code=<<<heredocs <html> <p> $msg1 </p> <p> $msg2 </p> </html> heredocs; echo $code; exit();
  14. Where IS the order by clause?
  15. That says that the post array is empty. Something is wrong with your submit - either the js validation routine is doing something to you, or the organization of the table and form tags has to be altered. I remember having some difficulties in the past when mingling those tags. Try removing the validation on your form tag and see if a plain old submit gives you anything in the post array
  16. Hmm..... Your error message says it is coming from 'contact.php' - is that the module you expect to be running at that time? I ask because your form has an invalid (?) action attribute. Did you define $PHP_SELF or did you mean to reference the PHP_SELF index of the $_SERVER array?
  17. ok - it appears that you 'should' have an item named 'Submit' in your post array. Do this - in the line before the error line add: print_r($_POST); exit(); and let's see what the post array actually contains.
  18. 1 - please use the proper tags which are square brackets containing the word code to begin and the word /code to end  when posting code. 2 - when you have a specific error and line no. it is nice to highlight that so that we can hone in on it. That said - you have one place where 'Submit' is used as an index: if($_POST['Submit'] == "Send") { You apparently do not have an input element (submit button?) named 'Submit'. What are the name= attributes of your type='submit' tags?
  19. Start writing - when you have a problem - come back with a question and a sample fo your code
  20. Where did you get it and why do you want to use it and what makes you think it's what you need/want? You really want to use some code that you don't know anything about, and can't read?
  21. More likely you want to move the file so that is reachable by your html code. Changing the root (is that possible?) could end up breaking your other code (if you have any) by making your relative paths no longer correct.
  22. oops - now I see some pieces of php code. First question - why ask us? Why not ask the person(s) you got it from?
  23. And how is this PHP related?
  24. Where do you set $company? And - this is going look screwy on screen since you have no space holder for the 'missing' company name. Is there a reason you are using a very unorthodox list? Why not a table without borders?
  25. Or better yet - run your php ahead of all this and set the 4 radio buttons check values ($chk_none,$chk_min,$chk_sup,$chk_full) prior. Then in the html you can just say: echo "<input type='radio' name='flag' value='full' $chk_full> full "; echo "<input type='radio' name='flag' value='supported' $chk_sup> supported "; echo "<input type='radio' name='flag' value='minimal' $chk_min> minimal "; echo "<input type='radio' name='flag' value='none' $chk_none > none ";
×
×
  • 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.