tweddlewalker
asked on
PHP ERROR Unknown column in 'where clause'
The lines which produce the error are:
if(!isset($_POST['searchFi eld_selap' ]))
{
$_SESSION['sess_idap']=$_S ESSION['se ss_over'];
}
Doing something stupid; could somebody please help?
if(!isset($_POST['searchFi
{
$_SESSION['sess_idap']=$_S
}
Doing something stupid; could somebody please help?
Sorry, but without knowing the rest of the code it's impossible trying to help you. There is nothing bad in those lines...
ASKER
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['searchFie ld_selap'] ))
{
$_SESSION['sess_idap']= $_POST['searchField_selap' ];
}
if(!isset($_POST['searchFi eld_selap' ]))
{
echo $_SESSION['sess_over'];
$_SESSION['sess_idap']=$_S ESSION['se ss_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.
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['searchFie
{
$_SESSION['sess_idap']= $_POST['searchField_selap'
}
if(!isset($_POST['searchFi
{
echo $_SESSION['sess_over'];
$_SESSION['sess_idap']=$_S
}
We put in the echo line to test with the resulting error:
ALGUnknown column 'ALG' in 'where clause'
I hope I have explained better.
Unknown column in 'where clause' is a database error message, not a PHP error message.
ASKER
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['searchFie ld_selap'] ))
{
$_SESSION['sess_idap']= $_POST['searchField_selap' ];
}
if(!isset($_POST['searchFi eld_selap' ]))
{
echo $_SESSION['sess_over'];
$_SESSION['sess_idap']=$_S ESSION['se ss_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.
On Page 1
$_SESSION['sess_over']= $_POST['sel_aport'];
On Page 2
linked with ahref not a form
if(isset($_POST['searchFie
{
$_SESSION['sess_idap']= $_POST['searchField_selap'
}
if(!isset($_POST['searchFi
{
echo $_SESSION['sess_over'];
$_SESSION['sess_idap']=$_S
}
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.
ASKER
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['searchFie ld_selap'] ))
{
$_SESSION['sess_idap']= $_POST['searchField_selap' ];
}
if(!isset($_POST['searchFi eld_selap' ]))
{
echo $_SESSION['sess_over'];
$_SESSION['sess_idap']=$_S ESSION['se ss_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.
On Page 1
$_SESSION['sess_over']= $_POST['sel_aport'];
On Page 2
linked with ahref not a form
if(isset($_POST['searchFie
{
$_SESSION['sess_idap']= $_POST['searchField_selap'
}
if(!isset($_POST['searchFi
{
echo $_SESSION['sess_over'];
$_SESSION['sess_idap']=$_S
}
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.
But where are you running the database query which produces the error message?
ASKER
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['searchFie ld_selap'] ))
{
$_SESSION['sess_idap']= $_POST['searchField_selap' ];
}
if(!isset($_POST['searchFi eld_selap' ]))
{
echo $_SESSION['sess_over'];
$_SESSION['sess_idap']=$_S ESSION['se ss_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.
On Page 1
$_SESSION['sess_over']= $_POST['sel_aport'];
On Page 2
linked with ahref not a form
if(isset($_POST['searchFie
{
$_SESSION['sess_idap']= $_POST['searchField_selap'
}
if(!isset($_POST['searchFi
{
echo $_SESSION['sess_over'];
$_SESSION['sess_idap']=$_S
}
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.
The session variable simply can't produce that error because it's a databes error. Can you post here the full page2?
ASKER
Thanks again.
This page opens correctly when searchField_selap is set.
Page is attached
This page opens correctly when searchField_selap is set.
Page is attached
You forgot to attach page :) But please, copy the code and paste it here using
: it's easier for us to take a look without downloading it...
ASKER
Hello again. Full code attached
Sorry, now I have to go for a while but... where is the code?
ASKER
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.
ASKER
We've found the error. You were right. It was in MySQL code. Thanks for your help.
ASKER
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.
Accepted answer: 0 points for tweddlewalker's comment #a39584561
for the following reason:
Saw our code error immediately.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Misunderstanding. I was so pleased that someone spotted the error. You can both have grade A.
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 ;)
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 ;)