Why am I getting a unknown column error when I try to join tables? And why won't my hyperlink work?

Why am I getting a unknown column error when I try to join tables? And why won't my hyperlink work?

SkrockiSkrocki Posts: 21Questions: 9Answers: 0

I've been teaching myself to program, using forums such as this one to pose questions now and then. I have spent a lot of time looking for the answers to my 2 questions, scouring this forum and stackoverflow. I also spent a long time trying to figure out how to provide a working demo of my errors, when it requires my database, because I notice many answers start with asking for a working demo. Short of creating a semi-secure sub-domain with a backup of my database, I hope putting my code on here will be enough to help you help me. I will create a sub-domain for this reason in the future, but I am pressed for time and can't do it now. If anyone knows a service where I can put up a demo and access a database without me having to write a whole min-website, I'd love to hear about it.

I'm having trouble joining tables. For a short while, I was getting an error (I forget the error now) but my results were returning with the correct number of records, but I couldn't see anything visible in the grid other than the column with "Edit" in place as a hyperlink to open my editing page for each record. I messed with some code, and now it's back to saying it can't find a column, that DOES exist in the database.

Have I provided enough code for one of you hyper-intelligent ACTUAL programmers to see why I get that missing field error and/or why my hyperlink won't work?

I humbly and gratefully ask if anyone can help?

Thanks, Steve

My code is here: http://live.datatables.net/xexowoso/1/ but it doesn't work as a demo because I have no database connection.
```
Screenshot of my Excel file where I organize my variables and let Excel concatenate repetitive code. This demonstrates which fields come from and save to which tables.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,726Questions: 1Answers: 10,110 Site admin
    Answer ✓

    Hi,

    You are using deets_insured.claim_number which references the table deets_insured. But that table name isn't mentioned anywhere in the table names? Your main table is called claimtracker and you join to deets_activity and deets_inspection.

    Perhaps a left join is missing?

    Also, you'll need to update the client-side code from:

    "data": "insured_name"
    

    to:

    "data": "deets_insured.insured_name"
    

    since that is what you refer to the field as on the server-side. That is also probably why the a link isn't working.

    Allan

  • SkrockiSkrocki Posts: 21Questions: 9Answers: 0

    My man! Thank you so much. I apologize for the simple mistakes, as I said I am learning as I go. Your answer was right on and I've got the page working except the hyperlink. I'm still working on that, but I didn't want to delay my thank you. I appreciate your time, I know it is valuable and it means a lot that you gave some of that time to my issue. Have a great day.

Sign In or Register to comment.