For Programmers: Free Programming Magazines  


Home > Archive > PHP Pear > September 2005 > Re: [PEAR] [HTML Quickform] addElement(-,-,-, array('value' => ...









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [PEAR] [HTML Quickform] addElement(-,-,-, array('value' => ...
Massimiliano Arione

2005-09-28, 6:58 pm

Damien Cros wrote:
> $select = "select PRODUCTNAME from PRODUCTS where PRODUCTNAME =
> '".$selectedDomain."'";
> $product = $db -> getOne($select);


What is $selectedDomain ?? Maybe it should be $myProduct ?
BTW, you should do your query as follows:

$select = 'select PRODUCTNAME from PRODUCTS where PRODUCTNAME = ?';
$product = $db -> getOne($select, $myProduct);

otherwise, your variable is not escaped.

--
Massimiliano Arione

http://garakkio.altervista.org
Massimiliano Arione

2005-09-28, 6:58 pm

Damien Cros wrote:
> sorry, my mistake. You're right, it's $myproduct.
> But it does'nt work anyway :-/


It's more likely a problem with your database than with quickform.
Try to do some debug with sql and $db, e.g. print_r($db), echo
$db->last_query, etc.


--
Massimiliano Arione

http://garakkio.altervista.org
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com