I am attempting to set up a 2 field form which submits data to a mySQL database, which in turn outputs this onto a webpage. A little bit of interactivity for the user. In ASP no probs...php is another matter! I'm not even getting it to write to the database.
Here is my code:
Input page:
<?
$username="nickyfarrell";
$password="qsw8ba";
$database="nickydb";
$name=$_POST['name'];
$event=$_POST['event'];
$comments=$_POST['comments'];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database"

;
$query = "INSERT INTO tableme VALUES ('','$name','$event','$comments')";
mysql_query($query);
mysql_close();
?>
<form action="insert_info.php" method="post" name="nickyform" id="nickyform">
<table width="410" border="0" cellpadding="2">
<tr>
<td nowrap="nowrap"><div align="right">Name : </div></td>
<td nowrap="nowrap"><input name="name" type="text" id="name" />
</td>
</tr>
<tr>
<td nowrap="nowrap"><div align="right">Event : </div></td>
<td nowrap="nowrap"><input name="event" type="text" id="event" />
</td>
</tr>
<tr>
<td valign="top" nowrap="nowrap"><div align="right">Comments : </div></td>
<td nowrap="nowrap"><textarea name="comments" cols="40" rows="5" id="comments"></textarea>
</td>
</tr>
<tr>
<td nowrap="nowrap"> </td>
<td nowrap="nowrap"><div align="left">
<input type="submit" name="SUBMIT" value="Submit" />
</div></td>
</tr>
</table>
</form>
Output Page:
<?
$username="nickyfarrell";
$password="qsw8ba";
$database="nickydb";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database"

;
$query="SELECT * FROM tableme";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Database Output</center></b><br><br>";
$i=0;
while ($i < $num) {
$name=mysql_result($result,$i,"name"

;
$event=mysql_result($result,$i,"event"

;
$comments=mysql_result($result,$i,"comments"

;
echo "<b>Name: "$name </b><br>"Event: "$Event <br>"Comments:" $comments<br><hr>;
$i++;
}
?>
I'm really sorry to trouble you but it all seems to be fine. I've set up my priveledges on the database as they should be. I'm not getting any error messages...it just isn't outputting anything expect the HTML bits.
Thank you for your time,
Peter