-
Posts
2,134 -
Joined
-
Last visited
-
Days Won
42
Everything posted by benanamen
-
You may also want to look into Temporal Data Tables or Audit Logging depending on your specific needs.
-
The best way to do DB backups is not with PDO. What you want to do is write a shell script that acts directly on the DB and set up a CRON job to run it at whatever intervals.
-
The first thing you need to do is stop mixing obsolete mysql_* code with mysqli.
-
If you passed it in as a parameter you would never have to edit anything and could use the function for any currency
-
By the way, your test_input function is a block of code from the 90's that needs to be taken behind the barn and shot and buried forever. Surprised to still see that floating around. Additionally, NEVER EVER put variables in your query. You need to use prepared statements
-
What is this "bridge" you created? What do you mean "doesn't allow direct access to mysql Server"? What does Mysql have to do with where you are putting your Php code?
-
Why are you using Cookies for the login instead of sessions? Do you know the differences?
-
Joining two tables as sums with individual records
benanamen replied to 684425's topic in MySQL Help
1. If those are your real column names you need to change them to something meaningful. Nobody knows what BBB or YYY or CCC means. 2. You likely have a DB design problem that needs to be normalized. Tell us about this data and what it represents. -
Is This How To Display Results With mysqli_stmt_bind_result()
benanamen replied to 2020's topic in PHP Coding Help
Hi Unique Idea Man, AKA UIman, AKA visiter52, aka 2020. After THREE years of us trying to teach you about Mysqli and coding under your various alt's across numerous forums, are we really right back at at the very beginning as though you have never seen this stuff? -
$_SERVER['PHP_SELF'] is vulnerable to an XSS Attack. Just delete the action completely. Yes, it is, but it is a Security problem and shouldn't be used. You "could" use it if you enclosed it in htmlspecialchars but that is just sloppy. Cleaner to leave the action out completely.
-
print "<p style='color:red;'>Could not delete the blog entry because :<br/>" .mysqli_error($dbc);
-
Ooops, meant exception.
-
You can use set_exception_handler to create a custom exemption function. https://www.php.net/manual/en/function.set-exception-handler.php
-
php Clickable phone number from mysql fetch data
benanamen replied to nishanperera's topic in PHP Coding Help
<a href="tel:123-456-7890">123-456-7890</a> -
help finding a matching word within a phrase of text. using a string.
benanamen replied to x1705's topic in PHP Coding Help
This page may be of help to you. We all started at the beginning. http://www.catb.org/~esr/faqs/smart-questions.html -
help finding a matching word within a phrase of text. using a string.
benanamen replied to x1705's topic in PHP Coding Help
What is the real problem you are trying to solve by doing this? What is the high level overview of what you have going on? -
add redirect to specific URL to submit button
benanamen replied to Faisal777's topic in PHP Coding Help
OP, do not create duplicate posts. Duplicate of https://forums.phpfreaks.com/topic/310907-help-to-add-redirect-url-to-submit-button/ -
The else is not needed. function tax_invoice($state, $subtotal, $credit, $shipping) { if ($state == "FL") { return ($subtotal - $credit + $shipping) * .07; } return 0; }
-
Allow me to introduce you to the NOT conditional. https://www.techonthenet.com/mysql/not.php
-
You do realize there is a difference between == and = right?
-
What is the real problem you are trying to solve by doing this?
-
Random records from one table based on a row from other table
benanamen replied to 684425's topic in MySQL Help
You first need to fix your DB design. Consecutive numbered columns is a red flag your DB is wrong. Look up "Database Normalization" and then fix the DB. -
LOL, that's exactly where I got that from. He really has been a ghost. Hasn't shown up anywhere.
-
Op, you would do better to separate the first and last names into their own columns. A simple use case example for using only the last name would be the intro to a letter. As is, you would have to do some code gymnastics just to get the last name only. Dear Mr. Doe,