Are you sure you really need to use all three? I don't think escaping it twice would do much besides add extra slashes.
virtual pets forum - Virtual pets news - Gaming discussion - General chat - Art marketplace
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/
I know addslashes isn't hack-proof, not sure about mysql real escape but it doesn't hurt to use extra precaution I guess.



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
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? :-/
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!!
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!
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?



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