MySQL Forums
Forum List  »  PHP

Re: Adding data from ARRAY to database table
Posted by: Peter Brawley
Date: April 10, 2006 09:15PM

1. _What_ array?

2. The code shown does not check the result of ...

$res = mysql_query($SQL_SELECT_Table, $conn) or ...

3. In any event, to check for the row's existence you need only to write

SELECT COUNT(*)
FROM Non_Processed_Enities_Table
WHERE EIN = 943184503;

The huge SELECT is simply waste of resources.

4. The INSERT query is unconditional. Is that what you intend?

5. No code is shown to fill $filted_results (you mean $filtered_results?) so I cannot make sense of that command.

6. You get an 'Unexpected $end' error because the code has an unclosed quote.

Quite a mess. I suggest ...

(i) Write no code at all until you have written out all the logical steps of the job to be done, one per line, making sure there are no logical loopholes by asking at least two other people to check it.

(ii) Have a look at the PHP manual page for mysql_query().

PB

Options: ReplyQuote


Subject
Written By
Posted
Re: Adding data from ARRAY to database table
April 10, 2006 09:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.