Re: mysql_real_escape_string
| From: | Michael Weaver | Date: | Sat, 17 Feb 2007 16:07:13 +0000 |
| Subject: | Re: mysql_real_escape_string | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-43096@lists.php.net to get a copy of this message | ||
Hi Ron,
One thing that you could do is name the variables as an array as opposed to creating a series of like-named variables.
Instead of:
<input name="web_site_1" type="sometype" ../>
<input name="web_site_2" type="sometype" ../>
<input name="web_site_3" type="sometype" ../>
...
<input name="web_site_11" type="sometype" ../>
Which would give:
$web_site_1
$web_site_2
$web_site_3
...
$web_site_11
You could set up the variables as:
<input name="web_site[1]" type="sometype".../>
<input name="web_site[2]" type="sometype".../>
<input name="web_site[3]" type="sometype".../>
...
<input name="web_site[11]" type="sometype".../>
This would give you a $web_site array which could then be looped through:
for($i = 0; $i < count($web_site);$i++)
{
$web_site[$i] = mysql_real_escape_string($web_site[$i]);
}
Hope this helps and is what you are looking for....
Best regards,
Mike Weaver
--
Michael Weaver
Founder/Chief Facilitator
Dynamic Insight
Enhancing Professional Awareness & Communication
Tel: 1.814.574.4871
Email: weaver@dynamicinsight.com
The information in this email and subsequent attachments may contain
confidential information that is intended solely for the attention and use of
the named addressee(s). This message or any part thereof must not be disclosed,
copied, distributed or retained by any person without authorization from the
addressee. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.