Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About Karaethon

  • Rank
    Advanced Member
  • Birthday 11/08/1978

Profile Information

  • Gender
  • Location
    United States
  • Interests
    Coding, Gaming, Girls

Recent Profile Visitors

374 profile views
  1. I need to reset my autoincrement value, I had a minor goof in my insert code and it ws inserting data wrong, i have fixed it but im now over 1000 rows in and all error posts are deleted, its not a big deal on a bigint but i want to start over at the beginning for my own OCD issues. how/can this be done?
  2. Yeah, thats what I ended up doing. and why hate 'snippets'? thats what they are, pieces of html that by themselves are just a piece of the whole page. like footer, header, menu, etc. what would you call them? pieces? chunks? (truffle shufle)
  3. This thread has evolved into a PDO lesson (for me), should I start a new topic specifically for my PDO questions?
  4. Its kinda silly. I have code snippets, pieces of code that i use often in several places, so i save them as .snip, when I include them they run php code but i needed to call one via ajax and it wasnt running php code because it wasnt .php i finally realized that giving it a ohp extension was the logical, least effort, option.
  5. ok, been playing with pdo... i get a good connection (i believe, because no errors are being thrown) but my attempt to query is not working... <?php include '../includes/dbconn.inc'; $player = $link->prepare("SELECT * FROM players WHERE PlayerID=?")->execute(['1']); echo $player; echo $player->fetch(); ?> is failing, at first echo $player is: 1 at fetch error is thrown: 'Call to a member function fetch() on boolean whats going on?
  6. No, I meant if the table has col1, col2, col3... do I have to make the PDO query in the same order? i understand that it will bind my values regardless of where they are in the array, I just want to know do I have to put the INSERT order to match the table order. i.e: INSERT INTO table (col1, col2, col3) VALUES ( :arg1, :arg2, :arg3) where the data was [arg1=>'test1', arg2=>'test2', arg3=>'test3'] OR could I use INSERT INTO table (col3, col1, col2) VALUES ( :arg3, :arg1, :arg2) where the data was [arg1=>'test1', arg2=>'test2', arg3=>'test3']
  7. Alright, I've been reading the article and I have a question you might know the answer to: When using a PDO prepared statement to INSERT via an assosiative array do I need to put the inserted columns in the array in the same order they are in the table?
  8. Yeah, I did once it was working. the final version of that function is in a class here where i was asking for help with a diffeent part.
  9. Ok... so I googled PDO and found a phpdelusions.net about it, will this be a good introduction for me?
  10. Hmm, ok... well I started playing with php/mysql back in 2003, then had a minor 15 year vacation... so i know im behind the times... where can i go to read/learn this new PDO stuff? I'm currently using my old 'PHP, MySQL, Javascript, & HTML5 all-in-one for dummies' as a basic reference, I got it on that "vacation" to try to stay in the loop but i know its old now itself. (copyrighted 2013).
  11. hmm, ok i need to learn about these prepared queries i think... and i guess i thought sanitize = validate, but i guess there is a difference i know i SHOULD write once, but I tend to be a bit thick-headed so i put in exra verbose error code so i know whats wrong at code time... Ieally need to break my bad habits and develop beter ones, thanks for the input.
  12. And with that it's fixed... so hard to see the diference at my screen size and resolution...
  13. well yeah i guess final isnt the right word, the original code was used in a testing file not the final file, I test pieces separately first to make sure they are doing what I expect then move them to my working file which becomes the final after completion and testing.
  14. Thanks for the info, I'm not sure if it matters but this class will only be called by other classes whose job is to sanitize user input so i dont think i have to worry there and the error handling is at the moment only for testing server when placed on live server that will all be gone. And nope I'm not sure about back-ticks i just kinda copied the phpmyadmin output and tried to match it. OHHH I SEE IT! the phpmyadmin isnt using back-ticks! theyre single quotes! i had to zoom in to catch that.
  • 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.