Jump to content

Recommended Posts

I get the following message:

name4Query failed: Unknown column 'late' in 'field list'

with this code.  What does it mean?

<?php
$apt=$_POST['search_term'];
$stat = mysql_connect("localhost","root","");
$stat = mysql_select_db("prerentdb");
$query = "SELECT name FROM payments WHERE late = 'L'";
$stat = @mysql_fetch_assoc(mysql_query($query));
echo $stat["name"];
$name=$_POST['name'];  
$apt=$_POST['apt']; 
$amtpaid=$_POST['amtpaid'];  
$rentdue=$_POST['rentdue'];  
$prevbal=$_POST['prevbal'];
$hudpay=$_POST['hudpay'];  
$tentpay=$_POST['tentpay']; 
$datepaid=$_POST['datepaid'];
$late=$_POST['late']; 
$comments=$_POST['comments'];  
$paidsum=$_POST['paidsum'];
$query = "
INSERT INTO payhist (name,apt,amtpaid,rentdue,prevbal,
hudpay,tentpay,datepaid,late,comments,paidsum)
VALUES('$name','$apt','$amtpaid','$rentdue','$prevbal',
'$hudpay','$tentpay','$datepaid','$late','$comments','$paidsum')";
$stat = mysql_query($query) or die('Query failed: ' . mysql_error());  
mysql_close();
echo "data inserted<br /><br />"; 
?>

Link to comment
https://forums.phpfreaks.com/topic/225270-trying-to-insert/
Share on other sites

  • 1 year later...
Guest
This topic is now 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.