Jump to content
MakeWebGames

Recommended Posts

Posted

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

  • Replies 53
  • Created
  • Last Reply

Top Posters In This Topic

Posted

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?

Posted

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

Posted

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 ?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...