Solved

PHP SQL error PLEASE HELP ME!!

Posted on 2011-03-24
6
291 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
Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

758 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