Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 303
  • 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
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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