Solved

PHP SQL error PLEASE HELP ME!!

Posted on 2011-03-24
6
292 Views
Last Modified: 2012-05-11
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
Comment
Question by:Rcollins207
6 Comments
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 35206705
frontpagetest
FONT, not front
0
 
LVL 27

Accepted Solution

by:
Lukasz Chmielewski earned 500 total points
ID: 35206711
$query="UPDATE wp_postmeta SET fontpagetest='$chkboxestest' WHERE post_id='$chkboxesID'";
:)
0
 
LVL 38

Expert Comment

by:Aaron Tomosky
ID: 35206725
Nice catch roads. I looked at that for a good 5 min and my eyes lied to me
0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 14

Expert Comment

by:svgmuc
ID: 35206730
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
 
LVL 27

Expert Comment

by:Lukasz Chmielewski
ID: 35206791
I was just lucky :P
0
 
LVL 1

Author Comment

by:Rcollins207
ID: 35210651
OMG thanks GJ i played around with that for ages lol
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
php refresh button on the browser 2 35
Alter an update query which rounds 7 30
html input type 3 21
Facial recognition to look through the whole database for a person 3 40
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now