how to get and pass database value through include in php
<p>I'm having a problem. here is my code.     </p>

<pre><code>$_GET['id']=2;
include 'operation/visual_console/render_view.php';
</code></pre>

<p>this code is ok. it gives the correct page with having the <code>id=2</code>. but i want is , to get that id value from the database. not by the hard-code it.</p>

<p>thank you.</p>

<p>hi everyone,</p>

<p>sorry for the poor coding.my data base connection is ok.i'll did it correctly.but the thing is this is my 1st post and i made some mistakes.so sorry for that again.and my question is solved by my self here is the new code and the above missing parts.        </p>

<pre><code>    &lt;?php
    function map()
    {
    $con=mysql_connect("localhost","root","abc123@#");
    mysql_select_db("pandora", $con);

    // Check connection
    if (mysqli_connect_errno($con))
    {
    echo "Failed to connect to MySQL: " . mysqli_connect_error();
    }

    $idAgent = (int)get_parameter('id_agente', 0);
    $lidAgent = db_get_value('id_layout', 'tlayout_data', 'id_agent', $idAgent);
    $_GET['id']=$lidAgent;

    include 'operation/visual_console/render_view.php';

    }
    mysqli_close($con);
    ?&gt;
</code></pre>

<p>so now it's ok.thank you for bothering me.</p>
