i have what seems to be a fairly simple php / sql problem.
I am trying to select data from an Ingres database.
Basically, a user would enter a value into input.php
when this is submitted the value would be parsed to form part of the sql statement.
This is however coming up with an error.
I have included the code from both pages below:
Please Help:
===============
INPUT.PHP
<form action="test.php" method="post">
Name:
<br>
<input type="text" name ="name">
<p>
<input type="submit">
</form>
==============
OUTPUT.PHP
<table border=2 cellpadding=10>
<tr>
<th>name</th>
<th>address</th>
<th>age</th>
</tr>
<?php
$link = ingres_connect (group)
or die ("Could not connect");
print ("Connected successfully");
?>
<?php
$sql = sprintf ("select name, address, age from people where name=%s",$name );
ingres_query ($sql);
while ($row = ingres_fetch_row()) {
?>
<?php
echo "<tr>";
echo"<td>$row[1]</td>";
echo "<td>$row[2]</td>";
echo "<td>$row[3]</td>";
echo "</tr>";
}
?>
</table>
<p>
</font>
<?php
echo "<br>\n";
ingres_commit();
?>
===============