Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

How to use an external database
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: How to use an external database
#50955
How to use an external database 9 Years, 8 Months ago Karma: 0
My configuration:
Joomla 3.3
ARI Smart Content


This works on joomla:
Code:


{source}
<body>
<?php

//my MS SQL connection
include "/var/www/rct/includes/rct.php";

$query = "Reports 'rcStats', 'BCN'";
$result = mssql_query($query);

echo "<table border='1'>
<tr>
<th>Item</th>
<th>Qty</th>
</tr>";

while($row = mssql_fetch_array($result)) {
echo "<tr>";
echo "<td>" . $row['Item'] . "</td>";
echo "<td>" . $row['Qty'] . "</td>";
echo "</tr>";
}
echo "</table>";


//close the connection
mssql_close($dbhandle);

?>
</body>
{/source}





How can I use the table in the follow code:

Code:


{source}

{arijdatatable bPaginate="true"}
{arisqltable}
{arisqltablequery}
      SELECT `name`, `texto` FROM `menu` WHERE `name` = 'company' ORDER BY texto
{/arisqltablequery}
{/arisqltable}
{/arijdatatable}

{/source}





Thanks in advance?
JM
The administrator has disabled public write access.
 
#50956
Re:How to use an external database 9 Years, 8 Months ago Karma: 747
Use the following code:

Code:


{arijdatatable bPaginate="true"}
  {arisqltable}
    {ariconnectionstring dbHost="localhost" dbUser="user" dbPass="pass" dbName="joomla" dbType="mssql"}{/ariconnectionstring}
    {arisqltablequery}Reports 'rcStats', 'BCN'{/arisqltablequery}
  {/arisqltable}
{/arijdatatable}



Just specify correct connection parameters in attributes of {ariconnectionstring} tag.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#50959
Re:How to use an external database 9 Years, 8 Months ago Karma: 0
The code is not showing anything. No error. Nothing.
Instead of the procedure "EXEC Reports 'rcStats', 'BCN'", I tried with a vary simple select but nothing appears.

What can be the reason of that?

Regards,
JM
The administrator has disabled public write access.
 
#50960
Re:How to use an external database 9 Years, 8 Months ago Karma: 747
Probably an incorrect connection parameters are used.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#50961
Re:How to use an external database 9 Years, 8 Months ago Karma: 0
There aren't anything wrong in the ariconnectionstring related with username, password .... I already check.

Can be anything related with microsoft sql driver?

Regards,
JM
The administrator has disabled public write access.
 
#50962
Re:How to use an external database 9 Years, 8 Months ago Karma: 747
Could you provide a link to a page where the problem occurs and a temporary access to J! backend by email so we can investigate the problem?

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 12