Solved

PHP SQL error PLEASE HELP ME!!

Posted on 2011-03-24
6
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 39

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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Procedure 7 50
Change background images after 5 seconds. 12 48
DMV Script to find how many times statistics are utilized 2 30
Position image fpdf 4 19
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

752 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