close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Issues with results page and field named state

Thread began 3/10/2014 4:00 pm by sandy170299 | Last modified 3/10/2014 4:39 pm by sandy170299 | 318 views | 4 replies |

sandy170299

Issues with results page and field named state

I'm getting an error in my search results page: Column 'state' in where clause is ambiguous. I have a field named state in each tqable, but I have renamed one of them in the query, but the error is not going away. I am attaching my page of code.

Sign in to reply to this post

Jason ByrnesWebAssist

on this line:
$WADbSearch1->addComparisonFromEdit("state","state","AND","=",0);


you need to include the tables that should be searched for the state column:

$WADbSearch1->addComparisonFromEdit("lostdogs.state","state","AND","=",0);

Sign in to reply to this post

sandy170299

Duh! I should have known that! I knew I had encountered it before, but just couldn't remember what the #@$% to do about it. Too much stuff going on today! Thank you, Jason!

Sign in to reply to this post

Jason ByrnesWebAssist

no worries.

JUST FYI, you can prevent this happening by using a naming convention that will prevent duplicate names.

the naming convention is like to use is to prefix the table name on the column:

members:
memberID
memberFname
membersLname
etc...


lostdogs:
lostdogCounty
lostdogState
lostdogGender

etc...


this way, looking at the column name, you know what table it belongs to without having to use the log hand:
table.column

and you also know you will never have a duplicate column name, so will never be able to encounter the ambiguous name error

Sign in to reply to this post

sandy170299

Good plan - thank you!

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...