PDA

View Full Version : mysql_real_escape_string


bee80
07-03-2009, 07:30 PM
is it ok to just use for example

mysql_real_escape_string($bbconnect,trim($_POST['firstName']));

$$bbconnect just contains db host,username,pw but not the actual db im connecting to, this is connected by the mysql_select_db($dbc)?

jaymo
07-11-2009, 05:29 PM
I usually use real escape string with individual variables before they go to the database, so not sure about the above. Try echoing the whole thing and see what you get.

bee80
07-12-2009, 09:41 AM
yes sorry forgot to show the variable $firstName in the code but thats what im wondering, will try as u said thanx