Inserting into MySQL

wxdqz

New Member
ok, I'm new to this so bear with me, but I don't see why this isn't updating my database.
------------------------------------
<?php
function language() {
?>
<form action="Admin.php" method="post">
<input type=hidden name=op value=http://www.phpbuilder.com/board/archive/index.php/addlang>
<table align="center" width="100%" cellpadding="3" cellspacing="1" bgcolor="#000000">
<tr bgcolor="#c0c0c0">
<td><font face="Verdana" size="2">Name:</font></td>
<td><input type="text" name="name" size=20 maxlength=20></td>
</tr>
<tr bgcolor="#c0c0c0">
<td><font face="Verdana" size="2">Personal Cost:</font></td>
<td><input type="text" name="home_cost" size=20 maxlength=20></td>
</tr>
<tr bgcolor="#c0c0c0">
<td><font face="Verdana" size="2">Host Cost:</font></td>
<td><input type="text" name="host_cost" size=20 maxlength=20></td>
</tr>
<tr bgcolor="#c0c0c0">
<td><font face="Verdana" size="2">Platforms:</font></td>
<td><input type="text" name="platform" size=20 maxlength=20></td>
</tr>
<tr bgcolor="#c0c0c0">
<td><font face="Verdana" size="2">CPU Usage:</font></td>
<td><input type="text" name="cpu_usage" size=20 maxlength=20></td>
</tr>
<tr bgcolor="#c0c0c0">
<td><font face="Verdana" size="2">Speed:</font></td>
<td><input type="text" name="speed" size=20 maxlength=20></td>
</tr>
<tr bgcolor="#c0c0c0">
<td><font face="Verdana" size="2">Review:</font></td>
<td><input type="text" name="review" size=20 maxlength=20></td>
</tr>
<tr>
<td><input type="submit"></td>
<td><input type="Reset"></td>
</tr>
</table>
</form>
<?
}
function addlang($name, $home_cost, $host_cost, $platform, $cpu_usage, $speed, $review) {
$name = stripslashes(($name));
$home_cost = stripslashes(($home_cost));
$host_cost = stripslashes(($host_cost));
$platform = stripslashes(($platform));
$cpu_usage = stripslashes(($cpu_usage));
$speed = stripslashes(($speed));
$review = stripslashes(($review));
mysql_query("INSERT INTO language VALUES (NULL,'$name','$home_cost','$host_cost','$platform','$cpu_usage','$speed','$review')");
}

switch ($op) {

case "addlang":
addlang($name, $home_cost, $host_cost, $platform, $cpu_usage, $speed, $review);
break;
case "language":
language();
break;
}
?>
 
Back
Top