Hi Sami30181,
it’s the same like in your php-code before...
create your db_access script ( like user,pwd,database ( if it is another database than the modx db ) ) and include it in a SNIPPET
for example:
<?php
include "assets/yourdir/config/db_cfg.php";
include "assets/yourdir/config/db_functions.php";
...
read the url parameters
for example
...
$myPara=$_GET["Para"];
... validate if necessary...
generate your output
for example
echo\"<a href=".$_SERVER['PHP_SELF']."?id=".$myPara."&orderaction=buy">myActionName</a>\";
...
?>
And now the important part:
Embed your SNIPPET in the document
for example
be careful, the snippet call must be case sensitive that means, [[mySnippet]] will not work if the generated snippet-name is MYSnippet
If you want to use the Snippet uncached use:
And don’t forget to free the mysql-db-ressources
mysql_free_result($yourresult);
Hope this helps
Greetings LeftHanded