Web Design Forum: multipul real escape string - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

multipul real escape string Rate Topic: -----

#1 User is offline   ELITE 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 778
  • Joined: 30-March 08
  • Reputation: 0
  • Gender:Male
  • Location:stoke on trent
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 28 July 2009 - 06:19 PM

Hi All i would like to use real escape string for data that is been inserted into mysql database but there could be 50 plus fields in the database is there a function that can be used to do this thanks again
0

#2 User is offline   Jack Franklin 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 26
  • Joined: 28-July 09
  • Reputation: 1
  • Gender:Male
  • Location:Cornwall
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 28 July 2009 - 09:40 PM

Surely you want to do the escaping BEFORE inserting it into the DB? You could get all the values as an array. For example, if the values had been sent via a forum using POST:

$data = ($_POST['field1'], $_POST['field2']); 
$escapedData = new Array();
foreach($data as $d) {
$escapedData[] = mysql_escape_string($d);
}


Something along those lines?
0

#3 User is offline   ELITE 

  • Expert
  • PipPipPipPip
  • Group: Members
  • Posts: 778
  • Joined: 30-March 08
  • Reputation: 0
  • Gender:Male
  • Location:stoke on trent
  • Experience:Intermediate
  • Area of Expertise:Coder

Posted 28 July 2009 - 09:42 PM

Thats what i was after thanks
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users