-
Posts
153 -
Joined
-
Last visited
Never
Posts posted by MrXHellboy
-
-
The function count() does not work like this as far as i know... explode..... You forgot the delimiter......
-
Hi All,
Currently we have a little wordpress network.... We want to get all the latest network comments.
I have stored the db prefixes in an array
$prefixx = array('delo_', 'dna_', 'lcp_', 'os_', 'wp_');
Now i have this loop:
foreach ($prefixx as $prefix) { $comments = $wpdb->get_results(" SELECT ". $prefix ."comments.comment_author AS author, ". $prefix ."posts.post_title AS title,".$prefix."posts.guid AS guid, ".$prefix."comments.comment_date AS date FROM ". $prefix ."comments, ". $prefix ."posts WHERE ". $prefix ."comments.comment_post_ID = ". $prefix ."posts.ID AND ". $prefix ."posts.post_status = 'publish' AND ". $prefix ."comments.comment_approved = 1 ORDER BY ". $prefix ."comments.comment_date DESC ", ARRAY_A); foreach ($comments as $c) { $arr[$c['date']] = $c; } }
The goal to get the latest 10 comments (total) from all the tables. Like this, it works fine as i get all the comments, then sort them on key... But i get them ALL.
Is there a more efficient way like:
select ......
FROM table1, table2, table3 etc etc ?
-
This is stored in an array ?
-
Why would you want a human readable url query string with passwords and usernames? This is very vulnerable for malicious visitors! its not smart, especially with passwords. Dont do that! Use $_POST instead!
IF you still want this.... Dont use http_build_query as this will return a encoded url query string.
You have to build this manually like
page.php?Type=myparam&Username=dazd&Password=nk98830&id=0&Cols_Returned=numfrom,sentdata
replace the values with vairables so it will be dynamically
-
I am not familiar with Javascript. Absolutely not You have to wait till someone else see this topic... I am sorry
-
I think that how you try to call it is wrong as this works perfectly:
<?php $x = serialize(array('value_eq')); $y = unserialize($x); echo $y[0]; ?>
You used the PHP serialize function for this $fields ?
-
This is NOT PHP concerned!
Wrong place to post this. However, go for CSS and the how ? background-image: url naar img;
-
preg_match_all('@<field name="dbnr" format="Long">(.*)<\/field>@', $a, $matches); echo '<pre>'. print_r($matches, true).'</pre>';
-
Please put your code in here
-
Maybe this will offer some solution
-
You used a parameter which is not a LINk id (Link id generated by mysql_connect()).
For errors:
error_reporting(E_ALL); ini_set('display_errors',1);
-
date_default_timezone_set("Europe/Amsterdam"); print_r(getdate());
It returns a nice array with your requests
-
Help with what exactly ?
date_default_timezone_set("Antarctica/Palmer");
Sets the timezone and all thedate/time function are depending on this in a script.
-
And 1 thing more.
Why doesn't need
$new_array = array_merge($new_array, array_unpack($val, $str.$key."."));
brackets and
$new_array[] = $val;
does ?
It seems like you are overwriting this variable each time, but it doesnt... So what the big deal there
-
Unfortunately no.
Your first snippet was Ok. Everything was cool!
But now, the second index 'key' needs to become prefix_key because there was already an index called 'key'.
-
So for my understanding ?
Page 1 form.... Page 2 -> handler.... After handler has been done, you want to go to page 1 again ?
In that case... You can put
header('Location: http://www.example.com/');
@ the bottom
-
Lets say, 'prefix' for example. Doesn't really matter, as long as they all will be in the new array.
-
Thx! Any other possibility for this ? I want to use the keys as well, and add a prefix to the key accordingly.... Array_merge does not support key options in this way as far as i know.
So:
array(array('Key' => 1,2,3,array(4,5,6, array('Key' => 7,8,9))))
the second key 'Key' must get a prefix.... is not really possible with array_merge ?!
Cheers
-
Confirm that. The last result will be stored!
-
Hi all,
Ok, simple question...
just imagine a multidimensional array,
array(array(1,2,3,array(4,5,6, array(7,8,9))));
how to build a recursive function that will unpack all the arrays into 1 array.
Somehow, none of my tries has worked out properly
Cheers
-
What do you want with this.... ?
-
Which specific wordpress function do you use to retrieve all the pages ? For example http://codex.wordpress.org/Function_Reference/query_posts does have a special argument
-
I guess concatenation will not work with instances. You can create 2 separate methods and use a if construct to call the methods.
-
You declare the msg variable after a if construct, which means, they will only be set IF something is wrong. Do for instance for all:
$signup_username_msg = ''; @ the top of your script somewhere. and they are gone. Or you can check isset();
Count 'Banned'
in PHP Coding Help
Posted
Just give us your code and tell what you want.... We can check for you