Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Would help US if you did an echo of the $query so we can SEE what the query is running. And the rest that I asked to see. And what is this "$db->escape() function? Why are you not using a prepared statement to resolve the arguments?
  2. Did THAT query actually run? Cause the earlier example used 'roles_table' and this used 'roles' Perhaps if you showed us the code ie, the query, the execution and the check of the results.
  3. As Barand has said - the index you tried to use does not exist in the array. Why are you using it?
  4. Add this to the current_user function: echo "<pre>",print_r($current_user,true),"</pre>"; Put it just before you execute the return from there. Let's see what is being put into $current_user AND show us the new function after you do this as well as the output that gets generated from the echo.
  5. You are trying to reference an array called $current_user and the elements/indices do not exist in it. Show us the current_user() function since that seems to be how $current_user is created.
  6. It is telling you (the PHP manual, that is) that the function needs an array to work with, a function to be called as the array is processed and what gets returned from all the work back to the user. And that is Exactly what the code I wrote and gave to you shows you if you simply read it and make effort to understand it.
  7. Didn't W3 tell you? If you read the REAL manual you might have understood how that code works.
  8. you don't have error checking enabled. That might help you.
  9. You are starting to resemble a forum user who makes it a very annoying habit to post samples of code to find out what people think of his thinking and which one is better. Someone I blocked a long time ago. If you have a problem then show the problem code and tell us what is not happening and whatever error message you are getting. Why would you post old code that worked for you a long time ago (or did it not work and you kept it anway?) and ask about it?
  10. Post REAL code, not pictures of it. Nobody will do any work with that block you posted.
  11. I strongly suggest that you not use W3Schools for anything. The PHP manual is the best resource you have. So - you went to W3 and now you don't understand what they gave you. Gee. If you don't understand that very-simple-code then LOOK IT UP IN THE MANUAL. Hint: the line of code is using a bitwise operator. yes - I am being very hard on you. But I hate it when people join a programming forum and then refuse to do the work that is necessary. If you find it too hard then perhaps you are in the wrong world. As for the code it does work. If you know how to read the results. Try this: $a1=array(1,3,2,3,4); echo "<pre>"; print_r(array_filter($a1,"test_odd")); echo "</pre>"; exit(); function test_odd($var) { return($var & 1); } The code is asking for the Odd entries in that sample array. That's what it gives you - the indices of the odd elements. You could add some new code to read the results to actually output the real values from the array by using those indices in a loop to output the values instead of the indices. That's too much work for me.
  12. You have an extra , right before the ) as the error message is telling you. In the future when posting code that includes an error message with a line number it would be always helpful to point out that line when you show the code.
  13. Huh? That code sets the kinds of errors to report and then turns reporting ON.
  14. @requinix - Doh! So obvious and didn't see it.
  15. It says argument 8, not 7 And - I wouldn't define the phone field as an integer. You'll be sorry.
  16. I don't know why the simple header command is not working for you. UNLESS it's the lack of a capital L on 'location'. I have always used it that way and have only seen it that way. And it must be followed by an exit command
  17. Why not use a db table instead of an array? That way a quick query gives you your data and a small chunk of code can then build that array in any script you are running. Make it all part of a separate module and just include it and call it.
  18. Before that line add an echo of the contents of your query that you are binding these values to and see if they match up
  19. Why are you stuck with it? I'm assuming that that 'typo' could be your problem.
  20. All you have to do is show us LINE 96. Don't know about all that other stuff but since the error tells you the line you should show US that line.
  21. cooment_anon?
  22. A good programmer would do it the other way around. It would be so much simpler.
  23. Don't have a clue what you are doing and I see you haven't corrected your structure at all.
  24. I think that quitting would be a good choice. People are trying to help you but you are reading anything correctly.
×
×
  • 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.