JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Apr 22, 2014 13:54
Hello guys. I'm having a small issue. I'm loading a page using $.ajax, the loaded page has an html form on it and I would like that form to work without any kind of JS, sadly it doesn't, is there any work around to avoid sending the form's content via ajax?
Apr 22, 2014 13:32
Hello guys. I'm having a small issue. I'm loading a page using $.ajax, the loaded page has an html form on it and I would like that form to work without any kind of JS, sadly it doesn't, is there any work around to avoid sending the form's content via ajax?
 

PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Nov 6, 2013 18:18
@Danack I found it, it's called Argument swapping, and is exactly what I've needed
Nov 6, 2013 18:09
However, sometimes I need to add anchors to it, which in some other language the position of the words changes between them
Nov 6, 2013 18:09
I am doing that
Nov 6, 2013 18:06
For example %s goes to %eat something at %restaurant, in some other language could be %s blabla %restaurant blabla %something
Nov 6, 2013 18:05
I need some help with a sprintf function, when using it on a multi language platform, sometimes the word change between them, thus the values are in the wrong place, is there a way to trick this?
Nov 6, 2013 18:03
Hello guys
Aug 16, 2013 19:36
I'm trying to allow accent characters into #hashtags, however I haven't managed to make it working, this is what I tried: preg_match_all('/(^|[^a-z0-9_])#([a-z0-9_]+)/ui', $message, $matches); anyone have any clue what I could try?
Aug 16, 2013 19:34
Hello
Jul 30, 2013 20:07
Could you please tell me which would be faster, I have a column called Read, which can hold 0 [unread] and 1 [read], when I update the table, should I use set read = '1' or set read = '1' where read = '0'
Jul 30, 2013 20:06
Hello guys
Apr 22, 2013 09:23
@DaveRandom: thank you, I guess I'm going to use UNION, just one last question, as far as I can see, if I have 10 unique ID's, I'll have to UNION 10 SELECT queries, is this faster than putting them into a foreach($array as $unique_ID) : do query ?
Apr 22, 2013 09:20
@DaveRandom: In the GROUP BY statement you provided me I can see that each post got 2 comments, but only 1 is displayed, I tried to limit them to 3 but with no luck, is that possible?
Apr 22, 2013 09:15
@DaveRandom the query you provided is exactly what I need, going to check how GROUP BY works
Apr 22, 2013 09:13
@DaveRandom I'll google it right now, thank you
Apr 22, 2013 09:10
@DaveRandom thank you
Apr 22, 2013 09:10
Yes, the sorting is by the comments.id
Apr 22, 2013 09:08
@Ihsan, for example I have the following, SELECT * FROM comments WHERE IN (13, 20, 15) ... what I need, is the first 3 match for 13, 20 and 15, and LIMIT won't do it
Apr 22, 2013 09:05
So that certain ID can be one, or more
Apr 22, 2013 09:05
@Ihsan also I have to mention that I use IN ('ID', 'ID)
Apr 22, 2013 09:04
I must select the first three results that contains a certain ID, is there any way of doing that?
Apr 22, 2013 09:01
Hello folks, I got an SQL question as well :)
Apr 15, 2013 16:26
@DaveRandom and thanks for the help, really.
Apr 15, 2013 16:26
@DaveRandom huh? :) sorry if I wasn't clear enough
Apr 15, 2013 16:24
@DaveRandom @Chris I found the answer myself, finally: `foreach ($array1 as $key => $value) {
if(!array_key_exists($key, $array2)) {
$x = 1;
break;
}
}`
Apr 15, 2013 16:15
@DaveRandom It doesn't work, sadly. Take a look here if you have time: pastebin.com/UMVz2hL4
Apr 15, 2013 16:02
@DaveRandom Thank you, I'll test it now
Apr 15, 2013 15:58
@Chris the thing is that $array1 could have only one key, which exists in array2, and then I would like to return true;
Apr 15, 2013 15:57
For example, $array1 = array('one', 'two', 'three'); $array2 = array('three', 'four', 'five'); this would return false, while if $array1 = array('three', 'four'); return true
Apr 15, 2013 15:56
@DaveRandom No, because they will have different amount of keys
Apr 15, 2013 15:55
@chris This returns the matched arrays, what I need is if one key from $array1 differ from $array2 then to return false
Apr 15, 2013 15:51
@Chris thanks for the suggestion, let me give it a try
Apr 15, 2013 15:49
Is there any way of checking if the keys from $array1 exists in $array2? (array one will have an amount of keys while the 2nd one will differ) array_diff_key doesn't do the job, neither array_key_exists because I need to compare between two arrays.
Apr 15, 2013 15:42
Is there any way of checking if the keys from $array1 exists in $array2? (array one will have an amount of keys while the 2nd one will differ) array_diff_key doesn't do the job :(
Apr 15, 2013 15:41
Hello guys
Apr 14, 2013 23:40
@Jocelyn thanks mate, I have finally solved the issue.
Apr 14, 2013 23:24
@Jocelyn the thing is that the fields and values are in one single variable, it can't be used like SET ? (where ? will get my_field = 'value', my_field2 = 'value2', etc.)
Apr 14, 2013 23:18
@Jocelyn however if I remove the bind_param and add the variables directly in the UPDATE $table SET $columns_list it works just fine.
Apr 14, 2013 23:18
@Jocelyn You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?' at line 1
Apr 14, 2013 23:16
I stated in my reply, that I have changed to UPDATE table_name and doesn't work either
Apr 14, 2013 23:14
Thanks @Jocelyn for the reply, sadly no luck.
Apr 14, 2013 22:45
Update to: stackoverflow.com/questions/16004752/… can anyone take a look please?
Apr 14, 2013 21:52
I guess that confirms that I've searched before, LOL :D
Apr 14, 2013 21:51
0
Q: mysqli Fatal error: Call to a member function bind_param() on a non-object

Special K.I have a problem with a prepared statement, here is my code: function query_array($table, $data) { foreach ($data as $column => $value) { $columns[] = sprintf("`%s` = '%s'", $column, $this->db->real_escape_string($value)); } $column_list = join(',', $columns); // Prepare...

Apr 14, 2013 21:51
My bad =)
Apr 14, 2013 21:51
Oh, snap
Apr 14, 2013 21:50
Apr 14, 2013 21:50
Hello guys.
Apr 7, 2013 11:13
@uınbɐɥs thanks for the answer btw