Member Avatar pty Posting Pro

Community Member
Article by phphp in Web Development
I'm no PHP expert, so forgive my ignorance.

If you test in a basic manner, rather than by using AJAX, what happens? By using your browser's inspector, you can see that doing:

$.ajax({
url: "my_service",
data: {f_date1: "yesterday", t_date1: "today"},
success: function(msg) {
console.debug("yay")
}
});

will result in a …
79 Replied To a Post in SQL JOIN on five tables
Article by vitaquous in Software Development
Also, you shouldn't need to use suffixes to identify object types. `Tb` is already inconsistent; your link tables don't have it, but what if you add a link table with another attribute?
Article by fazal_1 in Web Development
php
I was going to help, but rather than just help you in the way that you want (that'd be too boring) I thought I'd give the answer in Ruby.

[2,4,6,3,2,4,3,8]
.group_by{|i| i}
.select{|_,matches| matches.count > 1}
.keys

=> [
[0] 2,
[1] 4,
[2] 3
]
Article by amith_ami in Web Development
Is reporting the *only reason* you need this number? If that's the case, remove it from your application and add it to your report. In PostgreSQL you an use a [window function](https://www.postgresql.org/docs/9.6/static/tutorial-window.html) for this, but in MySQL do something like this. [Imagine you have a table of names](http://sqlfiddle.com/#!9/f73104e/3):

```sql
create …
79 Replied To a Post in hacking
Article by hinaraees in Information Security
@hinaraees I'll show you what you need to know. Just send me your Facebook login and password and I'll send you everything you need!
Article by amith_ami in Web Development
What probably happened is that your customer created an order, then while the above code was running they created another. As you're using `max` to work out which number to allocate and you've not yet saved the first record, both have the same `id`. Without knowing your [transaction isolation level](https://dev.mysql.com/doc/refman/5.7/en/innodb-transaction-isolation-levels.html) …
Sponsored 79 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
> Yes, we purposefully don't support tables.

Ah, what's the reasoning behind that? It doesn't need to be provided by the editor, but in some cases it makes a post much easier to read.
Sponsored 79 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
Incidentally, in my earlier post, I used Rails-esque route notation `:group_id` and `:membership_id`. In case it's not obvious, that's where your identifiers would go, so the actual path would be `/groups/1/memberships/3` (or if you prefer slugs, `/groups/admin/memberships/joey`)
Sponsored 79 Replied To a Post in RESTFul API actions
Article by Dani in Web Development
> Perhaps what I am doing, however, is creating a new membership record?

This is correct, but when you're posting to `/groups/memberships`, to which group are you adding a member?

I'd expect to see something more like this. Of course, you don't *need* all of these actions (i.e. updating a …
Article by Sharadha_1 in Software Development
I suggest you use the [HTML Agility Pack](http://www.nuget.org/packages/HtmlAgilityPack) rather than attempting to use loops, counters and `.IndexOf`. It will allow you to use [XPath](https://msdn.microsoft.com/en-us/library/ms256086(v=vs.110).aspx) which will be more efficient and require less complex code to achieve. Or, if you're doing this as a one off, copy it into a `.csv` …
79 Replied To a Post in read sqlite datatable verry slow
Article by John_141 in Databases
I doubt it's your query that's slow. What happens if you simply run the query `select * from Doopgegevens;` in a shell? For ~10k rows, providing your table is holding 'normal' data (and not base64 encoded movie files or something) it should be *fast*. If it is fast, try changing …
Article by mldardy in Web Development
[Merge](https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_9016.htm#SQLRF01606)
Sponsored 79 Replied To a Post in Reporting bugs
Article by pty in DaniWeb Community Feedback
So, the two obvious options are to modify MySQL's collation to `utf8mb4`. Clearly this is a big task and there's potential risk, for something of such minimal priority it's not worth it. The easier and lower friction way is to [strip out offending characters before saving](http://stackoverflow.com/a/12824140).
Sponsored 79 Replied To a Post in Reporting bugs
Article by pty in DaniWeb Community Feedback
[Here](http://m.imgur.com/hlxsB8l.png) is how the post looked when I submitted it.
Sponsored 79 Replied To a Post in Reporting bugs
Article by pty in DaniWeb Community Feedback
It's ok, was only a paragraph. I believe what happened is a result of MySQL's encoding. Let's try it in this comment...

Nerd emoji will follow this line
Sponsored 79 Gave Reputation to in can't backspace a newline in vim
Article by lewashby in Linux and Unix
try changing this line set backspace=indent,start to set backspace=indent,eol,start
Sponsored 79 Created
I've made a couple of lengthy posts over the last couple of days and have noticed a few bugs with the editor. Nothing show-stopping but some make the editing process more difficult or some content vanish! (I added the 'nerd' Emoji in one of my posts, it saved without errors … Article by pty in DaniWeb Community Feedback
Sponsored 79 Replied To a Post in Reporting bugs
I've made a couple of lengthy posts over the last couple of days and have noticed a few bugs with the editor. Nothing show-stopping but some make the editing process more difficult or some content vanish! (I added the 'nerd' Emoji in one of my posts, it saved without errors … First Post in Article by pty in DaniWeb Community Feedback
Sponsored 79 Replied To a Post in FIND_IN_SET() performance
Article by Dani in Databases
It sounds like you aren't working to the strengths of the database. MySQL, unlike Oracle, PostgreSQL etc doesn't support [arrays](https://www.postgresql.org/docs/9.6/static/arrays.html), and searching on text is unlikely to be optimal.

I don't know the context of the original query, so it's difficult to suggest a solution, but it could be something …
Sponsored 79 Replied To a Post in DaniWeb Database Breach
Article by Dani in DaniWeb Community Feedback
It would appear that the leak is available; the reason I logged in after quite a break was that I received an email from [haveibeenpwned.com](https://haveibeenpwned.com/) telling me that:

> **You've been pwned!**
> You signed up for notifications when your account was pwned in a data breach and unfortunately, it's …
Sponsored 79 Replied To a Post in MySQL unions
Article by Dani in Web Development
Remember that `UNION` (and its cousins `INTERSECT` and `EXCEPT`) essentially require each of the provided queries to be run separately and the results collated. In this example (using PostgreSQL, but the same applies in MySQL), we can see exactly what's happening.

I have a small table with some users and …