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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.