• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 306
  • Last Modified:

PHP SQL error PLEASE HELP ME!!

the error im getting is Unknown column 'frontpagetest' in 'field list'

My data base structure is in the image...

Sorry guys im new to PHP so explain like you would a 5 year old LOL :P

$chkboxestest = $_POST['chkboxestest'];
		$chkboxesID = $_POST['chkboxesID'];

		 if ($chkboxestest == '1') {
		
	  $dblink2 = mysql_connect("localhost", "username", "password");
	  mysql_select_db("mul23072_wrdp2",$dblink2);
	 $query="UPDATE wp_postmeta SET frontpagetest='$chkboxestest' WHERE post_id='$chkboxesID'";

	 mysql_query($query) or die(mysql_error()); 
	 echo $chkboxestest;
	 echo $chkboxesID;

Open in new window

database-image.jpg
database-field-image.jpg
0
Rcollins207
Asked:
Rcollins207
1 Solution
 
Lukasz ChmielewskiCommented:
frontpagetest
FONT, not front
0
 
Lukasz ChmielewskiCommented:
$query="UPDATE wp_postmeta SET fontpagetest='$chkboxestest' WHERE post_id='$chkboxesID'";
:)
0
 
Aaron TomoskyTechnology ConsultantCommented:
Nice catch roads. I looked at that for a good 5 min and my eyes lied to me
0
Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

 
svgmucCommented:
Your column is named fontpagetest.
In your code, you add an r to the name, making it  fRontpagetest.
That's why it doesn't work.
0
 
Lukasz ChmielewskiCommented:
I was just lucky :P
0
 
Rcollins207Author Commented:
OMG thanks GJ i played around with that for ages lol
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now