Hello everyone,I built a sample e-banking application as part of a project from my school. I wrote the statement below to update two tables from fields submitted from a form and also send a mail to the form owner. when i submit the form it redirects to the finale.php page but does not update the database at all..

// When a visitor has logged into this site, the Session variable MM_Username set equal to their username. // Therefore, we know that a user is NOT logged in if that Session variable is blank. if (!empty($UserName)) { // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. // Parse the strings into arrays. $arrUsers = Explode(",", $strUsers); $arrGroups = Explode(",", $strGroups); if (in_array($UserName, $arrUsers)) { $isValid = true; } // Or, you may restrict access to only certain users based on their username. if (in_array($UserGroup, $arrGroups)) { $isValid = true; } if (($strUsers == "") && true) { $isValid = true; } } return $isValid;}

Thanks for the tip! I am using Dreamweaver for the scripting. The session variable does not exist in the mysql database so I am sure it won't work on phpmyadmin!Can you just peruse the code for me please?

Thanks for the tip! I am using Dreamweaver for the scripting. The session variable does not exist in the mysql database so I am sure it won't work on phpmyadmin!Can you just peruse the code for me please?

Of course the session variable doesn't exist in the database. That's why you have to do an echo of the variable that contains the entire query, and copy and paste the entire query (including the VALUE of the session variable). The query MUST work in PHPMyAdmin, otherwise it will never work.

Second, try adding the following line to check how many (if any) records are being returned.

die(mysql_row_count($query_recordset));

But what I would do in any case, is look into using the JOIN syntax to link the two tables, rather than rely on the where clause. Also, using quoted identifiers can also lead to hidden problems ('statement' is a quoted identifier). Look into using aliases. Using * can increase load, depending on how much data is being returned. Select specific columns.

Let me paste the table structure for you then. Maybe you can come up with a more efficient query. In the client and statement table, i have client_id which is the link between the two tables. Please note also that the session variable used by dreamweaver here is MM_Username (username = '".$SESSION['MMUsername']."'")Now i want to select from the client table client_id, account_balance and checkcodeand from the statement table client_id,account_balance, statement_credit,statement_debit and statement_details

In you original post, your code suggests you are fetching by client.username. You realise this will return the client and all it's statements. Is there a one-to-one constraint on client and statement or can a client have more than one statement? What are you expecting to see, in terms of row counts, with this statement.

The below should (if I have my sql correct) work. Two fields were commented out to avoid column name ambiguity. It is assumed by me, that these values will be the same anyway. If not, give them aliases (s.account_balance as statement_account_balance) and uncomment them.

Note: I don't do the work for people, by and large, but everybody gets one freebie.