-
Posts
2,134 -
Joined
-
Last visited
-
Days Won
42
Everything posted by benanamen
-
Its not clear how your data output correlates. Please provide a detailed description of the previous post. So far I have this output:
-
Give me an example of what the correct output looks like from that table.
-
Can you post an sql dump of your db please. I meant the the end goal, not how you are trying to get there. What should the correct result look like?
-
What is the overall goal? It looks like you are not going about this the right way.
-
You can only have ONE where. Second one should be AND BAD: WHERE tp.status = '1' WHERE td.entry_year = '2016' GOOD: WHERE tp.status = '1' AND td.entry_year = '2016'
-
Now that t is clear exactly what is being talked about...... Unchecked check boxes will not exist at all so that statement fails in that instance as well. After hours of painstaking translation of @Jaques1 "english", I was able to come up with something a programmer could understand. echo base64_decode('U291bmRzIHByZXR0eSBjbGVhciB0byBtZTogWW91IHJlY29tbWVuZCBhZ2FpbnN0IHRlc3RpbmcgZWFjaCBpbmRpdmlkdWFsIGZpZWxkIHdpdGggaXNzZXQoKS4gQW5kIEkgc3Ryb25nbHkgZGlzYWdyZWUgd2l0aCB0aGF0Lg0KIA0KTXkgcG9pbnQgaXMgdGhhdCBpbmNvbXBsZXRlIHN1Ym1pc3Npb25zIGRvIGhhcHBlbiBhbmQgc2hvdWxkIGJlIHRyZWF0ZWQgbGlrZSBhbnkgb3RoZXIgaW5wdXQgZXJyb3IgKGRpc3BsYXkgYSBwcm9wZXIgZXJyb3IgbWVzc2FnZSwgZW1pdCBhIDQwMCBjb2RlIGV0Yy4pLiBZb3UgY2Fubm90IHJlbHkgb24geW91ciBmb3JtcywgYmVjYXVzZQ0Kc29tZXRpbWVzIGZvcm0gZmllbGRzIGdldCBibG9ja2VkIGJ5IGJyb3dzZXIgcGx1Z2lucyAoYXMgaW4gbXkgZXhhbXBsZSkNCmV4cGVyaWVuY2VkIGNsaWVudHMgbWF5IHNlbmQgdGhlIGRhdGEgd2l0aCBjVVJMIG9yIGEgdXNlciBzY3JpcHQgcmF0aGVyIHRoYW4gc3VibWl0dGluZyB5b3VyIGZvcm0gKHdoaWNoIGlzIHBlcmZlY3RseSBsZWdpdGltYXRlKQ0KdGhlIGNsaWVudCBtYXkgaGF2ZSBjYWNoZWQgb24gb2xkIHZlcnNpb24gb2YgdGhlIGZvcm0NCkFsbCB0aG9zZSBjYXNlcyBzaG91bGQgbGVhZCB0byBhIHByb3BlciBlcnJvciBtZXNzYWdlLCBub3QgYSBwaWxlIG9mIFBIUCB3YXJuaW5ncyB3aGlsZSB5b3UgdHJ5IHRvIOKAnHZhbGlkYXRl4oCdIGZpZWxkcyB0aGF0IGRvbid0IGV2ZW4gZXhpc3QuDQogDQpPSz8gSWYgeW91IHN0aWxsIGRpc2FncmVlLCB0cnkgdG8gbWFrZSB0ZWNobmljYWwgYXJndW1lbnRzLiBNeSBFbmdsaXNoIHN1Y2tzPyBNZWgu');
-
Your mistake is in trying to determine a duplicate client based on an address. A client should have some unique identifier. An address can have several units or suites so it cannot be unique to a client. Additionally the same exact address can exist across city's or states. In a normalized database you would have street names in it's own table with a unique index on the street name and then do an INSERT IGNORE to that table when adding new clients street names. In your form you could use an AJAX auto-complete for the street name field that would pull any existing street names If your database is setup correctly it would be impossible to insert duplicate anything.
-
I have to agree. I had to read the response several times to make sure who the response was directed to. @Jaques1 has shown over and over again a VERY high degree of expert knowledge even in highly technical subjects, even to the point I have suspected he is or was an operative for the NSA, CIA, or MI6. I have yet to find him wrong about anything and trust me, I have tried to challenge him a couple times only to find out he was absolutely right.
-
The second way. The first one is a <?= str_rot13('Pyhfgre Shpx') ?>
-
OP, Just learned something new. if(isset($_POST['submit']) can FAIL in Internet Explorer if form is submitted with all empty fields, and there is no name attritbute for submit therefore anything within that code will fail since it will never run. The no fail way is to do: if($_SERVER['REQUEST_METHOD'] == 'POST') I am digging deep into if ($_POST) to see if there are any issues I don't know about with that method.
-
Problem is here if($_POST){ Delete it. Your form tables are bad as well. All your tables are missing closing tags No closiing tr or td's, or table. And you shouldnt be using a tables for your forms. Use CSS. And you should probably switch around your if else post to if($_POST) instead of the negative if not post. Also, there is no need to create all those useless variables.
-
DO NOT SET THE PASSWORD IN A SESSION NEVER EVER EVER! It would also appear that you are storing plaintext passwords. VERY VERY BAD! You are also not even setting anything at all to those sessions anyways. On top of that you keep changing the username/password names. You have FOUR variations. If you had error reporting turned on like you should, you would be getting errors. It seems you are hacking away at this one piece at a time. You would do well to study a few PDO login/reg systems to see how things are being done. You are not even close to doing this right.
-
Also Use of session_register() is deprecated, use $_SESSION DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
-
You didnt use session_start at the top of your code. And all this: $username = $_POST['user']; $password = $_POST['pass']; $username = stripslashes($username); $password = stripslashes($password); Could simply be: $username = stripslashes( $_POST['user']); $password = stripslashes($_POST['pass']); Dont create variables for no reason.
-
After all this dont you think you should tell us what was wrong?
-
I know a record id is needed. What I am saying is you don't need to create an extra variable unless you are transforming it somehow. If $_POST is true, your form has been submitted so no need to see if submit isset. Less code, much cleaner and does the same exact thing. Yes, but no. You dont want to display the system error messages to the user. The way I handle errors is display some generic message to the user, log the error to my error log and have the system email me the details as soon as there is an error. I have an option to turn debugging on in which case it will display the full errors in the app during development. If you use set_exception_handler you don't have to keep writing try/catch blocks all over.
-
Most likely {$row['id']} Whatever your ID column is named. echo "<tr><td><a href=\"kf_orders_entered_detail.php?id={$row['id']}\">{$row['ompCreatedBy']}</td>";
-
FYI: This is completely unnecessary. Don't create extra code that does nothing. $record_id = $_GET['record_id']; You dont need all this either: if(isset($_POST['submit']) Just use: if ($_POST) Also, all the following is unnecessary. Just put your query in a try/catch block. If the query fails you will catch the error. For a global solution to catching errors you can use set_exception_handler. What you have below will not tell you anything about the error should you have one. if($insertStmt == true) { echo 'success'; } else { echo 'false'; }
-
I am not having any problems. first you load into zodiacyears, then zodiac but are selecting from zodiac1 You are all over the place with tables. Delete all but ONE table, empty it and load fresh Then use a mysql gui like phpmyadmin and look at your table as soon as you do the import and make sure the data is getting imported. This is so not a complicated situation.
-
Is your data separated by tabs or spaces?
-
There is nothing wrong with the connection code. If the same username, password and DB name works in your other code it should work in this code.
-
Post your entire connection code. Hide your username and password