PHP ERROR Unknown column in 'where clause'

The lines which produce the error are:

if(!isset($_POST['searchField_selap']))
{
 $_SESSION['sess_idap']=$_SESSION['sess_over'];
}

Doing something stupid; could somebody please help?
tweddlewalkerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Marco GasiFreelancerCommented:
Sorry, but without knowing the rest of the code it's impossible trying to help you. There is nothing bad in those lines...
0
tweddlewalkerAuthor Commented:
Sorry to have been over brief. Thank you for your quick reply.

On Page 1
$_SESSION['sess_over']= $_POST['sel_aport'];
sel_aport is three character text string
with an ahref, not form, link to Page 2

On Page 2
This page is normally reached through a form om Page  3
if(isset($_POST['searchField_selap']))
{
$_SESSION['sess_idap']= $_POST['searchField_selap'];
}

if(!isset($_POST['searchField_selap']))
{
 echo $_SESSION['sess_over'];
$_SESSION['sess_idap']=$_SESSION['sess_over'];

}

We put in the echo line to test with the resulting error:
ALGUnknown column 'ALG' in 'where clause'

I hope I have explained better.
0
Dave BaldwinFixer of ProblemsCommented:
Unknown column in 'where clause' is a database error message, not a PHP error message.
0
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

tweddlewalkerAuthor Commented:
Thank you for your reply. Sorry to have been too brief.

On Page 1
$_SESSION['sess_over']= $_POST['sel_aport'];

On Page 2
linked with ahref not a form
if(isset($_POST['searchField_selap']))
{
$_SESSION['sess_idap']= $_POST['searchField_selap'];
}

if(!isset($_POST['searchField_selap']))
{
echo $_SESSION['sess_over'];
 $_SESSION['sess_idap']=$_SESSION['sess_over'];
}

The echo is in as a test. The error line is now:
ALGUnknown column 'ALG' in 'where clause'
The echo is right the session variable produces the error.

I do hope you may be able to advise.
0
tweddlewalkerAuthor Commented:
Thank you for your reply. Sorry to have been too brief.

On Page 1
$_SESSION['sess_over']= $_POST['sel_aport'];

On Page 2
linked with ahref not a form
if(isset($_POST['searchField_selap']))
{
$_SESSION['sess_idap']= $_POST['searchField_selap'];
}

if(!isset($_POST['searchField_selap']))
{
echo $_SESSION['sess_over'];
 $_SESSION['sess_idap']=$_SESSION['sess_over'];
}

The echo is in as a test. The error line is now:
ALGUnknown column 'ALG' in 'where clause'
The echo is right the session variable produces the error.

I do hope you may be able to advise.
0
Marco GasiFreelancerCommented:
But where are you running the database query which produces the error message?
0
tweddlewalkerAuthor Commented:
Thank you for your reply. Sorry to have been too brief.

On Page 1
$_SESSION['sess_over']= $_POST['sel_aport'];

On Page 2
linked with ahref not a form
if(isset($_POST['searchField_selap']))
{
$_SESSION['sess_idap']= $_POST['searchField_selap'];
}

if(!isset($_POST['searchField_selap']))
{
echo $_SESSION['sess_over'];
 $_SESSION['sess_idap']=$_SESSION['sess_over'];
}

The echo is in as a test. The error line is now:
ALGUnknown column 'ALG' in 'where clause'
The echo is right the session variable produces the error.

I do hope you may be able to advise.
0
Marco GasiFreelancerCommented:
The session variable simply  can't produce that error because it's a databes error. Can you post here the full page2?
0
tweddlewalkerAuthor Commented:
Thanks again.

This page opens correctly when searchField_selap is set.

Page is attached
0
Marco GasiFreelancerCommented:
You forgot to attach page :) But please, copy the code and paste it here using

Open in new window

: it's easier for us to take a look without downloading it...
0
tweddlewalkerAuthor Commented:
Hello again.  Full code attached
0
Marco GasiFreelancerCommented:
Sorry, now I have to go for a while but... where is the code?
0
tweddlewalkerAuthor Commented:
Really struggling to upload it.  When we copy the text in, it won't accept it.  We have tried to upload twice.  Looks like there is a glitch in the upload part of the site.  Thanks for your patience.
0
tweddlewalkerAuthor Commented:
We've found the error.  You were right.  It was in MySQL code.  Thanks for your help.
0
tweddlewalkerAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for tweddlewalker's comment #a39584561

for the following reason:

Saw our code error immediately.
0
Marco GasiFreelancerCommented:
tweddlewalker, I'm not sure to understand your logic. Both DaveBaldwin and me said the error message was a database error message. Now, when you found we said the truth you want to close the question without awarding points: why? The problem is exactly what we said and no one else would can say something more without seeing the code so I think you should award poinbts both to Dave and to me with grade A or at least explain why do you think our comments can't be considered a solution.

Cheers
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
tweddlewalkerAuthor Commented:
Misunderstanding. I was so pleased that someone spotted the error. You can both have grade A.
0
Marco GasiFreelancerCommented:
Sorry, tweddlewalker, but there is still a misunderstanding. DaveBaldwin has been the first to notify you that the error was a database error in the comment ID: 39584400

I've been the second with my comment ID: 39584411

So, the right choice would be to award all points not to me but to Dave: I deserve only a little part of them since the real solution has been offered by Dave. Please, request attention to a moderator using the link in the question box above and change your decision.

You'll see the next time you'll feel more confortable with EE rules ;)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.