Good night,
I will try to explain my problem the best i can...
In my list view, i have a custom link in ID element wich redirect to an article: "index.php/component/content/article?id=4"
In this article i have a SOURCE php code which is:
{source}
<?php
$servername = "blabla";
$username = "blabla";
$password = "blabla";
$dbname = "blabla";
$con=mysqli_connect($servername, $username, $password, $dbname);
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_set_charset($con, "utf8");
$myrowid = '{rowid}';
$sql="SELECT ... WHERE id = '$myrowid' ";
$result=mysqli_query($con,$sql);
$row=mysqli_fetch_array($result,MYSQLI_NUM);
printf ("%s (%s)\n",$row[0],$row[1]);
?>
{/source}
My problem it?s the Where Condition in sql query....How can i tell that query that id is the first ID in list view selected?
If i click in my list view ID=41, i go to article ID=4 and in it, the where condition should be "Where id = '41'"
Could you help me,please?Or is there any other solutions for this?
Thank you in advance.
I will try to explain my problem the best i can...
In my list view, i have a custom link in ID element wich redirect to an article: "index.php/component/content/article?id=4"
In this article i have a SOURCE php code which is:
{source}
<?php
$servername = "blabla";
$username = "blabla";
$password = "blabla";
$dbname = "blabla";
$con=mysqli_connect($servername, $username, $password, $dbname);
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
mysqli_set_charset($con, "utf8");
$myrowid = '{rowid}';
$sql="SELECT ... WHERE id = '$myrowid' ";
$result=mysqli_query($con,$sql);
$row=mysqli_fetch_array($result,MYSQLI_NUM);
printf ("%s (%s)\n",$row[0],$row[1]);
?>
{/source}
My problem it?s the Where Condition in sql query....How can i tell that query that id is the first ID in list view selected?
If i click in my list view ID=41, i go to article ID=4 and in it, the where condition should be "Where id = '41'"
Could you help me,please?Or is there any other solutions for this?
Thank you in advance.