bender
02-21-2007, 04:15 PM
Hello,
I would like to know if it's possible to use a variable of a .tpl file in php.
Example:
Here is the variable {cat.ID} which gives me a login (number) that I would like to use in a php request.
{php}
$sql="SELECT * from PLD_CATEGORY WHERE PARENT_ID={cat.ID} LIMIT 1";
$result = mysql_query($sql) or die("Requete erronee");
while($val = mysql_fetch_array($result)) {
.....
.....
}
{/php}
I would like to use the variable {cat.ID} in my SQL request and integrate the all in a .tpl file.
Do you know how to do ?
Thank you for your help.
I would like to know if it's possible to use a variable of a .tpl file in php.
Example:
Here is the variable {cat.ID} which gives me a login (number) that I would like to use in a php request.
{php}
$sql="SELECT * from PLD_CATEGORY WHERE PARENT_ID={cat.ID} LIMIT 1";
$result = mysql_query($sql) or die("Requete erronee");
while($val = mysql_fetch_array($result)) {
.....
.....
}
{/php}
I would like to use the variable {cat.ID} in my SQL request and integrate the all in a .tpl file.
Do you know how to do ?
Thank you for your help.