I have the following code: $result = mysql_query(“SELECT first_name, last_name, employeeID FROM ecc_employee WHERE first_name != ” “); $resources = array(); while ($row=mysql_fetch_array($result)){…
phpmailer – The following SMTP Error: Data not accepted
I’m trying to figure out this issue for 6 hours. But there is nothing to make sense. Here is the scenario; There is a well formatted HTML template. Here is the array of recipients’ mails; Everything looks fine and email ready to send.Here is the phpmailer config; Everything is same when I test it.…
Collect all values in a multidimensional array with a specific key
I have an array like this: How can I get all [id] values from this array and store them in a flat array like this: Answer $a is your original array.
Create a new page and add contents to it using PHP
This is going to be hard to explain so please ask me for clarification if anything confuses you. So let’s say that I am on createpage.php. Within this page, I have the following tasks. Create a new …
Where can I find unit tests for regular expressions in multiple languages?
I’m building a regex helper at http://www.debuggex.com. The amount of detail I want to show requires me to write my own parser and matcher. To make sure my parser and matcher work correctly, I’ve …
PHP htmlentities not working even with parameters
Of course this has been asked before and have searched for solutions, all which have not worked thus far. I want to change out the TM symbol and the ampersand to their html equivelents by using htmlentities or htmlspecialchars: This displays: I have also tried it with htmlspecialchars and the second parameter…
Getting radio button value and sending through ajax to php
I have a poll on my website which displays radio buttons next to each answer. When the user selects an option and submits, im running a a php script via ajax to insert the value or the selected radio …
Custom Regular Expressions [closed]
It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 9 years ago. How is it possible t…
Sort array and keep values of keys
I have an array that looks like this: and I would like to sort the teams by the number of points each team has. I have tried this: But that approach overrides the keys containing the teamnames and returns: Is there any way to sort the array without overwriting the teamnames as the array keys? Answer Use the u…
Inserting data in MySQL table only if it doesn’t exist already: trouble with INSERT IGNORE
so I’ve been looking around StackOverflow and the MySQL manual for a while, and I can’t seem to solve my problem. What I’m trying to do is simply make my data INSERT function such that it doesn’t add anything to my table if it already exists. I saw a few methods: the INSERT IGNORE func…