View Single Post
Old 12-05-2007, 03:31 PM   #16 (permalink)
SOCK
The Acquainted
 
Join Date: Nov 2007
Posts: 154
Thanks: 31
SOCK is on a distinguished road
Default

Quote:
Originally Posted by YBH View Post
Oh I think I get it. From your example sock...

So in my Short Variable it automatically adds stripslashes if I use the POST method and I'm using magic_quotes. My question is though, if they plan to remove magic_quotes, what other ways can I do it instead of if (get_magic_quotes_gpc) ?
I see what you're saying. I think the decision to move to v6 and retooling is always a big deal. I wouldn't really worry too much about it; at the most, if you check for magic_quotes now and use the method I've recommended, you'll have to edit only a small portion of your code.

What might be a better way to future proof your scripts is to have an included script that performs some of these basic tasks for you in one location. Then you only need to alter one script.

Quote:
Originally Posted by YBH View Post
It seems as prepared statements will save me a lot of time from coding. What I dont understand is the "sssd" I see it says on the table

s - corresponding variable has type string
d - corresponding variable has type double

I understand the "s". But I dont understand what a "double" is from the d.
You need a primer on basic data types. Check out the 'language reference' section on 'types' (in fact, read that entire section). A 'double' is synonymous with 'float' in PHP, e.g. '1.35'. Same precision. NOTE: other languages may discern between these two, but PHP is relatively weakly typed.

The most important lesson I can impart to anyone is to understand the basic data types and the proper way to manipulate and store them. After all, this is what programming is all about, manipulation of data.

As an afterthought, you might take a look at how the functions sprintf() and printf() work. Tinker with that a bit to understand how to interact with different data types.
SOCK is offline  
Reply With Quote
The Following User Says Thank You to SOCK For This Useful Post:
YBH (12-06-2007)