Re: table not showing in explorer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Still wont work. did a few tests and it seems like Explorer wont print the
table when i use a form variable.  the script will notify if there are no
results, but nothing if any. - no table
oh, and what info in phpinfo() would i need to look at if its the prob.?
thanks

=====================================
<html lang="en">
<head> <title>Code Search</title>
</head>
<body>
<center>

<table width="90%" border="0" cellspacing="1" cellpadding="0"
bgcolor="lightblue">
<form name="campcode" method="post" action="<?php print("$PHP_SELF");?>">
<tr height=30><td>Search:</td><td><input type="text" name="code"></td>
<td><input type="submit" name="submit" value="Search"></td></tr>
</form></table>
 </center>
<br><br>
<?php
    $dbconnect = pg_connect("dbname=campus user=apache");
    //$code_query = $code;
    $code = strtolower($code);
    if($submit) {
      if($code=="") {print "You need to enter a query!"; exit;}

    //WORKS in Explorer
    $qry_get_camp_codes = "select id,name from campuslist where name ilike
lower('%HOUSTon%')";
    //DONT WORK in Explorer
    //$qry_get_camp_codes = "select id,name from campuslist where name ilike
lower('%$code%')";
    $result = pg_query ($dbconnect, $qry_get_camp_codes);
	  if (!$result) {printf ("Error\n"); exit;}
      if (!pg_numrows($result)) { echo "<font color=\"red\" size=4>no
result</font>"; exit;}
    print "<center>";
    print "<table border=1>";
	print "<tr><td>ID</td><td>NAME</td></tr>";
    while($myrow = pg_fetch_row($result)) {
	printf ("<tr><td>%s</td><td>%s</td></tr>"
    , $myrow[0], $myrow[1]);
    }
    printf ("</table></center>
    ");
    }
pg_close($dbconnect);
?>
</body>
</html>

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux