help with php display

Hello! pls. help me with understanding what i’m doing wrong. I’m a newbie PHP user and somehow I try to do my best but right now I’m really at my wits end. I have a table

teachertable

empid section name time
102012 II jane 0800
102012 II jane 1200
102012 II jane 1500

heres what I want to do, After my distinct items I created and listed a link from within and when I click on it it will show everything its kinda view all but a little different. my code is below.

<?php include('config.php'); $mod = $_GET[mod]; $myid =$_GET[id]; //Connection script to postgres server.....OK callme($myid); /* save item*/ $sq1 ="SELECT DISTINCT empid FROM teachertable"; $result =pg_query($sq1); //for refid display below while ($row = pg_fetch_array($result)){ echo ''; echo ''; echo ""; echo ''; echo '
".$row["empid"]."
'; } function callme($myid){ if($_REQUEST[nir]==1){ $q1 =" SELECT * FROM merchantable WHERE empid = ('$myid')"; $result =pg_query($q1); //or die(pg_last_error()); while($rows=pg_fetch_array($result)){ echo $rows[empid]."
"; } } } ?>

the good thing about this is its not getting any error but my problem it has no output it seems that my $myid is not enough. please help. thanks in advance!! :smiley:

You could try turning errors on. Put this at the top of php file:

[php]ini_set(‘display_errors’, ‘On’);
error_reporting(-1);
[/php]

print $myid, $result and see whether result is coming as you expected.

Sponsor our Newsletter | Privacy Policy | Terms of Service