Follow us on...
Follow us on Twitter Follow us on Facebook
Register

User Tag List

Page 40 of 60 FirstFirst ... 30383940414250 ... LastLast
Results 391 to 400 of 593
  1. #391
    Junior Member
    Join Date
    22 Nov 2011
    Posts
    79
    Threads
    3
    Blog Entries
    2

    My User Ranks

    My Reputation

    Re: Learning PHP.. yay me.

    Are you sure you really need to use all three? I don't think escaping it twice would do much besides add extra slashes.
    My virtual pet site!
    http://www.mystikpets.com/

  2. #392
    VPL Supporter
    Join Date
    09 May 2011
    Posts
    908
    Threads
    102

    My User Ranks

    My Reputation

    Re: Learning PHP.. yay me.

    I know addslashes isn't hack-proof, not sure about mysql real escape but it doesn't hurt to use extra precaution I guess.

  3. #393
    Member Grotesque's Avatar
    Join Date
    17 Oct 2011
    Posts
    261
    Threads
    35

    My User Ranks


    My Reputation

    Re: Learning PHP.. yay me.

    Just use prepared statements, these are state-of-the-art

  4. #394
    Approved Programmer
    Join Date
    23 Jan 2011
    Posts
    824
    Threads
    40
    Blog Entries
    2

    My User Ranks




    My Reputation

    Re: Learning PHP.. yay me.

    I agree. Prepared statements are the way to to. Or if you don't get them, you could use something like my database object which wraps the use of them in what is IMO an easier way to use them.

    ~judda
    Personal Site, Blog, Development Projects all wrapped up into one convenient location. Click here to begin. I am very straight to the point ... if you don't like it ...just feel free to ignore me.

    Blog :: Development Blog :: Resume




    Virtual Pet News - Aggregator of all pet site News Feeds
    SQL Blog Feed - Aggregator of several SQL blog sites
    PHP Blog Feed - Aggregator of several PHP blog sites

  5. #395
    VPL Supporter
    Join Date
    09 May 2011
    Posts
    908
    Threads
    102

    My User Ranks

    My Reputation

    Re: Learning PHP.. yay me.

    Hmm, I looked into it but not quite understanding how it works just yet or how to really implement it.. can someone put it in n00b terms?

    also, I am constantly grabbing information from the tables and lots of it.. for instance if I'm pulling all the users items, and have to edit those items and such or grab one of the specific items, do I have to make a prepared statement for each scenario?

    Or is that not even relative? :-/

  6. #396
    VPL Supporter
    Join Date
    09 May 2011
    Posts
    908
    Threads
    102

    My User Ranks

    My Reputation

    Re: Learning PHP.. yay me.

    Does anyone code for hours and then have the code be absolute shit?

    I spent two days on my pet care feature and it will work for one pet but oddly enough, it won't work for the other!!

  7. #397
    Member Grotesque's Avatar
    Join Date
    17 Oct 2011
    Posts
    261
    Threads
    35

    My User Ranks


    My Reputation

    Re: Learning PHP.. yay me.

    Quote Originally Posted by BigThinker View Post
    Does anyone code for hours and then have the code be absolute shit?

    I spent two days on my pet care feature and it will work for one pet but oddly enough, it won't work for the other!!
    I think that happened in every life of a coder

  8. #398
    VPL Supporter
    Join Date
    09 May 2011
    Posts
    908
    Threads
    102

    My User Ranks

    My Reputation

    Re: Learning PHP.. yay me.

    lol well, it sucks! BUT I think i figured it out. I had to break down parts and pinpoint the many errors.. and plus, I had to do math. :-| sometimes the simple things are hard to figure out for me for some reason!

  9. #399
    VPL Supporter
    Join Date
    09 May 2011
    Posts
    908
    Threads
    102

    My User Ranks

    My Reputation

    Re: Learning PHP.. yay me.

    Okay, so an individual introduced me to database classes. I haven't implemented them on my website just yet, so my issue is based on regular old while loops while gathering information.

    I have a script where there are four while loops pulling from the same table. How do I go about making this more efficient? All of these loops are pulling multiple rows, and the WHEREs vary. Putting them in a function won't work because functions only return ONE variable (pain in the ass!).

    Also, they happen at different points in the script, and not at once, so maybe that helps with efficiency? Or maybe I should integrate the database class here or something?

  10. #400
    Approved Programmer
    Join Date
    23 Jan 2011
    Posts
    824
    Threads
    40
    Blog Entries
    2

    My User Ranks




    My Reputation

    Re: Learning PHP.. yay me.

    It'd be better if you posted your code. In general, you can likely do a JOIN to bring the data together ... but it depends on what you are asking for. Please post code

    The database class won't increase any efficiency of queries. It acts as a layer of abstraction between you and the database.

    ~judda
    Personal Site, Blog, Development Projects all wrapped up into one convenient location. Click here to begin. I am very straight to the point ... if you don't like it ...just feel free to ignore me.

    Blog :: Development Blog :: Resume




    Virtual Pet News - Aggregator of all pet site News Feeds
    SQL Blog Feed - Aggregator of several SQL blog sites
    PHP Blog Feed - Aggregator of several PHP blog sites

 

 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •