shrek1609 Posted May 2, 2009 Posted May 2, 2009 Re: How to use sprintf? i believe a string also contains SOME characters other than the alphabet... what i'm a bit confused on is why the need to use sprintf if we mres() or abs int on all the variables going into the query Quote
Floydian Posted May 2, 2009 Posted May 2, 2009 Re: How to use sprintf? http://criminalexistence.com/ceforums/i ... ic=16644.0 Read that forum post. It explains *why* to use sprintf. To summarize: it formats a string..., but do read the post... Quote
shrek1609 Posted May 2, 2009 Posted May 2, 2009 Re: How to use sprintf? just a thought here... if i use mysql_real_escape_string on the input of a username and the username is say dave's then the output of this will surely be dave\'s would this mean i would need to use stripslashes on the output? Quote
Floydian Posted May 3, 2009 Posted May 3, 2009 Re: How to use sprintf? it depends once you store the string dave\'s in the db, the \ is removed because mysql sees it as a control char and removes it but if you escape it and then echo it back to the user right away, then the user would see the slash Quote
shrek1609 Posted May 3, 2009 Posted May 3, 2009 Re: How to use sprintf? thanks floydian :) i've been having a play with mres() abs int and string_replace etc... and i've been echo'ing the results out straight away, never considered the database having an effect on them :) now for the long job of recoding every file :cry: p.s. just out of interest is there a difference between print and echo or is it just personal choice ? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.