I'm currently using modx and I have the following problem:
Currently I am passing the following variable from my chunk to my snippet: [!tax? ¶m1=`[+price_net+]`]
Then within my main snippet I am trying to convert that variable into a float, and search within my database:
<?php
echo $param1;
$converted = (float)$param1;
echo $converted;
if($converted === '123.00') echo 'Float'; /*This isn't printing out so I'm assuming its not converting properly?*/
$sql = "SELECT * FROM catalogue_items WHERE price_net = '".$converted."'" ;
$result=mysql_query($sql);
while ($row = mysql_fetch_array($result))
{
$name = $row['name'];
$price_net = $row['price_net'];
}
echo '<FORM METHOD=POST>';
echo 'Name<br/>';
echo '<input type="text" name="name" value="' .$name. ' "><br/>';
echo 'Price Net<br/>';
echo '<input type="text" name="price_net" value="'.$price_net.'" ><br/>';
echo '<input type=submit name="submit" value="Update"></p>';
echo '</FORM>';
?>
Hope that was somewhat clear!
Any help would be appreciated - I'm tearing my hair out now!
Bookmarks