Forum Moderators: coopster
I am experiencing a weired problem trying to retrieve data through PHP from a MySQL table. A simple SELECT always shows every field twice. ADODB and regular PHP-mysql functions give the same result...
Does anybody know about a similar problem and how to fix it? May be the combination of all the latest versions of Apache, PHP, MySQL?
I am quite clueless on this one. Any suggestion would help!
Thanks a bunch,
Stefan
But while I am typing this I get an idea. I am trying to work with FOREIGN KEY CONSTRAINTS for the first time and there is at least one other table "connected" (with ON DELETE CASCADE) to the table I am retrieving data from. But that would be really stupid if this screwed up my SELECT...
I am going to try this out, but it doesn't seem very likely.
Greets,
Stefan
One other thing, I dont think mysql supports foreign key constraints - you can put them in the sql statement but they will be effectively ignored (I think!).
I always thought that if you use mysql_fetch_array it would give you ONLY the associative array. I'll give it a try! But do you by coincidence know the equivalent function in ADODB for that?
Referring to foreign keys: I am using InnoDB and you don't have to specify anything in the SELECT statement. You have to tell the "connected" tables what the relevant action is if something happens in the parent table. I tried this out and it worked perfectly. It can save you a lot of work when you have many parent/child tables . The trigger options are ON DELETE and ON UPDATE.
Thanks again,
greets Stefan