Relationship with auto populate

A place for users and developers of the Xataface to discuss and receive support.

Re: Relationship with auto populate

Postby jhenry » Fri Jul 23, 2010 8:01 am

Paul,

I think this is the code:

Code: Select all
CREATE VIEW dataface__view_BillData_25218d6cd3d21b266386fb7fc42d58d1 SELECT b.*, s.SiteName, s.Eelectric, s.Gas FROM BillData b LEFT JOIN SiteData s ON b.SiteDataID=s.SiteDataID;



I always have to do this from the mysql prompt.

Jason
Do not mistake understanding for realization, and do not mistake realization for liberation....Tibetan Saying.
jhenry
 
Posts: 58
Joined: Sun Jul 12, 2009 1:20 pm
Location: Florida

Re: Relationship with auto populate

Postby cantlep » Fri Jul 23, 2010 8:38 am

Hi jason,

Thanks for the reply.

Yeah, I deleted the view and it did auto-recreate it but still errors. I'm sure there's probably a simple answer to it but I can't find it :-s

As I said, when I split the statement into 2 parts, it works fine. (with one section commented out). When I comment it back in a refresh the page, It functions as it should. It's just for new entries that it's not working for :-(
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Relationship with auto populate

Postby cantlep » Fri Jul 23, 2010 8:40 am

Ah, I didn't see your code snippet there. I'll give it a go.

Thanks :-)
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Relationship with auto populate

Postby jhenry » Fri Jul 23, 2010 9:42 am

Paul,

I didn't read the errors well enough but you were right it has to be from the double AND statements. Where are you doing the LIKE CONCAT statements? Is that done in a .php file or is it in the fields.ini.

I don't know if it helps but I am doing a very similar function where I have a Customers table and a account_taxes table. Each county here uses a different tax rate and I have to charge tax according to the location of the service. Each customer tax rate is selected in the Customers table from a lookup that uses the account_taxes table. So when I create a work order and select the customer I have the system query the customer database to get the proper tax rate multiply the rate times the labor hours and then total everything up at the end. I have a checkbox to select if the workorder is taxable (labor only has no tax) and then I have an onSave directive to total everything up. If this sounds like something similar to what you are doing let me know and I will post the Work_Orders.php that does the calculations.

Jason
Do not mistake understanding for realization, and do not mistake realization for liberation....Tibetan Saying.
jhenry
 
Posts: 58
Joined: Sun Jul 12, 2009 1:20 pm
Location: Florida

Re: Relationship with auto populate

Postby cantlep » Mon Jul 26, 2010 5:28 am

hiya,

The statement is in Billdata/BillData.php it's really weird how it works fine apart from when adding a new record. Once the record is in, that statement doesn't have a problem. I don't know why the view part of it isn't taking the SiteData column into account :-(
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Previous

Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 7 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved