Hi folks,

I have used my connection for all my scripts, but when I am trying to INSERT the BIRTHDATE of a register user scripts i get the ERROR below:

Check for mysql_real_escape_string() support.
   if (function_exists('mysql_real_escape_string'))
      {global $dbc; // Need the connection.
   $data = mysql_real_escape_string (trim($date), $dbc);
   } else {
  $data = mysql_escape_string (trim($data));

ERROR:

Warning: mysql_real_escape_string() expects parameter 2 to be resource, null given !!!!


I know it seems to be easy for the ones who knows about it, so please give me a hint!

Thank you very much

Masks.be

In the statement $data = mysql_real_escape_string (trim($date), $dbc); remove the $dbc and try it.

As in $data = mysql_real_escape_string (trim($date)); .

I think you might not have initialized your connection before calling the statement.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.