dickersonka 104 Veteran Poster

try moving the customerrors to directly below <system.web>

are you able to view the error on localhost, vs remote?

dickersonka 104 Veteran Poster

post your webconfig from the server, and i'll take a look

dickersonka 104 Veteran Poster

you just need to change what it tells you

open up the webconfig, search for customErrors and set mode to off and restart the web app, just to be safe

this setting basically just allows you to redirect errors to another page, rather than showing the error output to a customer

dickersonka 104 Veteran Poster

try with httpresponse and httprequest

dickersonka 104 Veteran Poster

i don't know about that trailing / with the .

what is the details on the exception?

try like this
http://msdn.microsoft.com/en-us/library/debx8sh9.aspx

dickersonka 104 Veteran Poster

what are the href's coming in as?

also capitalization

if it also says bad, then the exception didn't occur in that place, what are links coming in as, and what are they being resolved as?

dickersonka 104 Veteran Poster

are you meaning something like this?

foreach (HtmlElement link in webBrowser1.Document.Links)
            {
                bool isValid = false;
                string linkItem = link.GetAttribute("HREF").ToString();
                
                Uri urlCheck = new Uri(linkItem);
                WebRequest request = WebRequest.Create(urlCheck);
                request.Timeout = 10000;    // 10 seconds


                WebResponse response;
                try
                {
                    response = request.GetResponse();
                    isValid = true;
                    Console.WriteLine("Good");
                }
                catch (Exception)
                {
                    Console.WriteLine("Bad"); //url does not exist
                }
                
               if(isValid)
	   {
		listViewLinks.Items.Add(link.GetAttribute("HREF").ToString());
	   }
	}
dickersonka 104 Veteran Poster

ok we see your assignment, what have you done so far, what are you having trouble with?

dickersonka 104 Veteran Poster

it depends what you are doing at time of insert to the master table, if you are using a stored procedure you can use this

insert into mastertable .....

select @@identity

same as your other post, i would say to close the other one

dickersonka 104 Veteran Poster

what about a distinct

select distinct cust_no

its hard to see where the data is coming from here, if you are wanting the balance only from customer.balance

dickersonka 104 Veteran Poster

lol easiest way to explain it is be specific

from table1, table2 join table3 on id = table3.id

who knows what that means

now this

from table1 inner join table2 on table1.id = table2.id 
inner join table 3 on table3.id = table2.id

looks much clearer at least to me

dickersonka 104 Veteran Poster

you need to add a group by

GROUP BY cust_no,......
dickersonka 104 Veteran Poster

here i found an article on the suggestion i gave you earlier

its because order of precedence, also always try to do joins this way, makes much cleaner code

http://damonparker.org/blog/2006/02/23/mysql5-join-syntax-changes/

filch commented: Once again, a great help! +1
dickersonka 104 Veteran Poster

yes you did, now hopefully he will go down that path

dickersonka 104 Veteran Poster
select db_name()
omrsafetyo commented: It seems so obvious... +1
dickersonka 104 Veteran Poster

you did not post the error

dickersonka 104 Veteran Poster

you first post was close, you just needed to make your for loop call the second method, if true add it to the list, if false don't do anything

dickersonka 104 Veteran Poster

sure thing man, finally got up to veteran poster now along the way :-)

glad it all works for you, and i'm sure you understand relational databases much better

TORONTO here i come!!!

dickersonka 104 Veteran Poster

actually no need to check the uas table at all, just delete, then insert

you are correct, check user table i guess from a login or whatever that is, then no need to check anything against uas table except when displaying the form, on submit delete and insert

also i normally wouldn't suggest this, but i think it is appropriate here, we don't need a uas_id on uas table, it is always being deleted and never referenced, you can keep it, no big deal, its just not of use i see yet, but maybe keep it if you think you will need it later

filch commented: This man is amazing ... really! +1
dickersonka 104 Veteran Poster

no need to do a check, just run the delete, it won't matter if there is a match or isn't

then just run inserts

dickersonka 104 Veteran Poster

nice job man, much more rewarding when you find out how to do it, than when we just tell you

dickersonka 104 Veteran Poster

constraints will do what you are meaning, delete from the user table then it will propagate to other tables that reference that user

lol did i put delete *, just use delete from without the *

dickersonka 104 Veteran Poster

well it doesn't make sense as far as the user won't have any services, from the database side it just means there is a user, just no services saved yet

yes users -> uas 1..x

it means a user has been created, but no services have been created

dickersonka 104 Veteran Poster

should be the opposite, user_id can't exist in the uas table without being in the user_table

delete from the uas table only, not user table

try to run the command without php and see if you get any errors

dickersonka 104 Veteran Poster

noooo, not the user table

this is what i was meaning, i think you are using $u_id

delete * from useraccessservices where user_id = $u_id

maintain the user table, how do you get to the screen where you update your services? have to log in or anything? you should know a user id if you are loading fields based upon it

dickersonka 104 Veteran Poster

ahhhh, well we have no deletes here

i don't really like this option, but would you want to delete all the rows for that user_id prior to doing updates and inserts?


(edit: stupid me, there will be no updates if the rows are deleted :-) )

dickersonka 104 Veteran Poster
dickersonka 104 Veteran Poster

why do you need the extra table?

why don't you just query from occurences, the same one that you populated reminder with?

dickersonka 104 Veteran Poster

print the query right before its executed once values are subbed in, need to see what is happening here

dickersonka 104 Veteran Poster

there will be an entry in the array for each service for that user, the part i'm not sure about is how are you having duplicate id's?
40
40
40?

42
42
42?

dickersonka 104 Veteran Poster

not sure why they changed it

you don't see related features on the right? with aspnet code snippets?

dickersonka 104 Veteran Poster

you can also use mysql_num_rows to the same effect
http://us.php.net/mysql_num_rows

dickersonka 104 Veteran Poster

thats it man

the reason why you have to query all three for the uas, is because user_id has multiple airports and multiple services for each, without a uas_id then you need to query against all those

dickersonka 104 Veteran Poster

sorry about that, all you need to do see if there is a result or not

here's a link if you are ever interested
http://pear.activeventure.com/package/package.database.db.db-common.getone.html

dickersonka 104 Veteran Poster

they are on the right hand top side, much different layout though, not sure if i am up for it

here's a link as well
http://www.daniweb.com/code/

dickersonka 104 Veteran Poster

you sure you mean $aid instead of $a_id

also your update statement needs to be based on uas_id, otherwise , you will have multiple rows for each user in the update

dickersonka 104 Veteran Poster

see this database stuff isn't so hard now is it :-)

dickersonka 104 Veteran Poster

Correct, if you delete an airport or service then all records that reference that airport or service needs to be deleted as well

deletes on those CAN only happen in the primary tables(airport, services)

what i was referring to was if a user has a service, then the service is removed for that user only, the delete needs to happen in the uas table
ex (userid 1 has ground and glycol for airport id 2, now we want to remove ground for user 1 for airport 2, we only delete the uas record for that user in the uas table)

dickersonka 104 Veteran Poster

you are correct, String.split is the way to go to treat it the same as the tokenizer

the other way would be to use regex

dickersonka 104 Veteran Poster

the uas should allow deletes, inserts, and updates with no cascading, if you think of it, this is a bottom level table, no tables depend upon it, it depends upon other tables

if user_id gets updated in the user table, then the uas table needs updated as well, not the other way around

if the service_id gets updated in the services table, then the uas table needs updated, same way as before, not the other way around

i don't know exactly what error you were getting, but any changes to the uas table should affect key constraints on any other table, as long as user_id, service_id, and airport_id match, deleting or inserting should not affect anything

dickersonka 104 Veteran Poster

also what you could do which would probably be a better solution, just maybe more time consuming, is to create a hidden field that goes with each checkbox that stores the user_airport_services_id, if exists set it, otherwise set it to -1, then you can check if hidden field is -1 insert, otherwise update

<input type="hidden" id="YAVGLYCOL" value="4">
<input type="hidden" id="YAVJET" value="-1">

basic example, but you will know glycol has been assigned and to do an update, and jet hasn't and do an insert

up to you, which way you want to go with my previous post as well

dickersonka 104 Veteran Poster

make sure your reference is to C:\Program Files\Reference Assemblies\Microsoft\VSTO...... and not C:\Program Files\Common Files\Microsoft Shared\VSTO .......

dickersonka 104 Veteran Poster

lol whoaaa now

might have to come for toronto, can never turn down a free beer

you almost got it, what you can do is for each checkbox value, query the table, if exists, do an update, if not, do an insert

$query = "SELECT user_airport_services_id FROM user_airport_services WHERE user_id = '$u' AND SERVICE_ID='$s" AND AIRPORT_ID ='$a'";
$uasid= $db->getOne($query);
if ($count>0){
$query = "UPDATE user_airport_services SET ........  WHERE user_airport_services_id=$usaid;
}
else{
$query = "INSERT INTO user_airport_services .........
	}
$db->query($query);
dickersonka 104 Veteran Poster

yes, except the left join on user_id

the where clause is limiting the results to only ones that exist, if the change doesn't show the results properly, then let me know, and it can be modified

dickersonka 104 Veteran Poster

reverse the statement and use a left

select ....
from airports
left join user_airport_services
on ....
dickersonka 104 Veteran Poster

i don't have a mysql database in front of me right now, but trying changing that statement i gave you, to a right join instead of inner

dickersonka 104 Veteran Poster

i don't see how you are expecting idx = NULL for 2-6, when you have both entries for idy in both tables

are you sure this is what you are wanting?

dickersonka 104 Veteran Poster
select DATEDIFF(now(), '2008-12-25)
CodeBoy101 commented: Great!!! (^ - ^) +1
dickersonka 104 Veteran Poster

you need to specify inner join on (columnname)
maybe i just don't get it, lol but i cannot understand what you are trying to do here

dickersonka 104 Veteran Poster

not quite sure what you are meaning, show me what you want your result set to be and what your current query is