Jump to content

Please Help.


srhino

Recommended Posts

I have been staring at the computer all day and I can't see what I am missing....Can anyone tell me why I can't insert this info. Here is the code

<?php
include("includes/connection.php");
?>

<?php

$matchid = $_POST['matchid'];
$round = $_POST['round'];
$school1 = $_POST['school1'];
$school2 = $_POST['school2'];

$query = "INSERT INTO match (matchid, round, school1, school2) " .
          " VALUES ('$matchid', '$round', '$school1', '$school2')";

    $result = mysql_query($query) or die('Sorry, we could not post your tournament to the database at this time'. mysql_error());

    if ($result)
       echo "<a href=\"index.php\"><h2>Tournament posted</h2></a>\n";
    else
       echo "<h2>Sorry, there was a problem posting your tournament</h2>\n";

?>

 

Here is the form that is sending over the variables

<?php 

$matchid = $_POST['matchid'];
$round = $_POST['round'];
$school1 = $_POST['school1'];
$school2 = $_POST['school2'];



echo "<table width=\"100%\" border=\"1\" align=\"center\"><form action=\"newmatch.php\" method=\"post\">
<tr><td colspan=\"9\" align=\"center\">New Schools</TD></tr>
<tr>
<td width=\"10%\">Match</td>
<td width=\"5%\">Round</td>
<td width=\"75%\">Teams</td>
</tr>
<tr>
<td rowspan=\"2\"><input type=\"text\" name=\"matchid\" ></td>
<td rowspan=\"2\"><input type=\"text\" name=\"round\"></td>
<td><input type=\"text\" name=\"school1\" value=\"$school1\"></td>
<tr><td><input type=\"text\" name=\"school2\" value=\"$school2\"></td>


<tr><td colspan=\"4\" align=\"center\"><input type=\"submit\" value=\"Submit\">
<input type=\"hidden\" name=\"content\" value=\"newmatch\"></td></tr>
</form></table>"
?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/195865-please-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.