Monday, 30 January 2012

?

I am completely puzzled as to why this does not work...

<?php
$con = mysql_connect("localhost","admin");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  $PID=$_POST["fList"];
    $STDNTNAME=$_POST["fname"];
 $STDNTCMNT=$_POST["fcomments"];
 $TMSTMP=time();
$sql="INSERT INTO commenttable (PhotoID, StudentName, StudentComment, Date) VALUES
('$PID','$STDNTNAME','$STDNTCMNT','$TMSTMP')";
    mysql_query($sql); 
mysql_close($con)
?>

OH. I just remembered I forgot to select a database...I'll try that now

Odd...I cant connect

No comments:

Post a Comment