PHP Classes

multi params in query_secure

Recommend this page to a friend!

      PDO Multi Connection Class  >  All threads  >  multi params in query_secure  >  (Un) Subscribe thread alerts  
Subject:multi params in query_secure
Summary:add multiple params in SELECT query
Messages:4
Author:Marco Rossi
Date:2012-11-15 10:46:51
Update:2013-01-15 16:53:44
 

  1. multi params in query_secure   Reply   Report abuse  
Picture of Marco Rossi Marco Rossi - 2012-11-15 10:46:51
Hi!!

I just would want to know how to add multiple params in a SELECT query.

If i make this:

$params = array(":id|".$id."|INT",":froml|".$from_limit."|INT",":tol|".$to_limit."|INT");

the SELECT query doesnt work, if i make the same query with just 1 parameter it works normally...

How can i resolve this problem?

Thank you very much

Byezz!

  2. Re: multi params in query_secure   Reply   Report abuse  
Picture of Jay Lepore Jay Lepore - 2013-01-05 03:08:44 - In reply to message 1 from Marco Rossi
Did you ever figure that out ?

I am running into the same problem here.

Jay
CompuMatter

  3. Re: multi params in query_secure   Reply   Report abuse  
Picture of Marco Rossi Marco Rossi - 2013-01-11 15:56:56 - In reply to message 2 from Jay Lepore
I don't know how to resolve this problem....

  4. Re: multi params in query_secure   Reply   Report abuse  
Picture of Evert Ulises German Soto Evert Ulises German Soto - 2013-01-15 16:53:44 - In reply to message 2 from Jay Lepore
Hi Marco and Jay...

the answer is in manual file... im add little more params for a better comprension.

//SELECT statement with option "UNNAMED PLACEHOLDERS":
$params = array(2,'M');
$rows = $db->query_secure("SELECT NAME FROM TB_USERS WHERE ID=? AND GENRE=?;", $params, true, true);
if($rows!=false){
foreach($rows as $row){
echo "User: ". $row["NAME"] ."<br />";
}
}
$rows = null;

Regards!