So I have my database set up with with the appropriate values. But when I input values into the form my database stays at 0 rows with nothing going into it.
Here’s the site…
http://wiiklygamer.byethost16.com/
And heres my code…
Please excuse my sloppy layout
[php]
Wiikly Gamer
<?php
//are we being posted to?
if($_SERVER['REQUEST_METHOD'] == "POST"){
//yes! set our variables
$youtube_name = (isset($_POST['youtube_name'])) ? mysql_real_escape_string($_POST['youtube_name']) : '';
$mm_name = (isset($_POST['mm_name'])) ? mysql_real_escape_string($_POST['mm_name']) : '';
$course_title = (isset($_POST['course_title'])) ? mysql_real_escape_string($_POST['course_title']) : '';
$courseid = (isset($_POST['courseid'])) ? mysql_real_escape_string($_POST['couseid']) : '';
$sql = "INSERT INTO db_1 (youtube_name, mm_name, course_title, courseid) VALUES('$youtube_name', '$mm_name', '$course_title', '$courseid')";
mysql_query($sql) or die(mysql_error());
?>
<?php
}else{
//they didn't fill something in
$error = true;
}
}
if(isset($error) || $_SERVER['REQUEST_METHOD'] != "POST"){
//show the form
?>
|