I've created a subrutine to acces DB, but while sending the Query it get an error.


My function looks like:

sub DbSqlQuery
  {
  local $str_query = @_ if @_;
  print $str_query;
  <... blah, blah ..>
  }

And my program call it like:

<... blah, blah ..>
$str_Query = "SELECT admin_ID, admin_name FROM admins WHERE (admin_login = '$str_Login');
print "Content-type: text/plain\n\n TEST: $str_Query :: \n";
&DbSqlQuery($str_Query);
<... blah, blah ..>



When I run, I get the following output:


SELECT admin_ID, admin_name FROM admins WHERE (admin_login = 'my value') :: 1
 ERROR: 1
        1064 (You have an error in your SQL syntax near '1 ' at line 1)




Where it comes the '1'?


I must use pointers or similar?



--


saludos,



J. Alejandro Ceballos Z. | ---------------------------+--------------------------- http://alejandro.ceballos.info | [EMAIL PROTECTED] | "Las batallas contra las mujeres -------------------------------+ son las únicas que se ganan huyendo". | | -- Napoleon Bonaparte.


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to