Jump to content

voogah

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

voogah's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I've even used the following code which seems to be more direct, but it still does not show for Safari or Firefox! <?php require './wp-config.php'; function wp_get_current_user() { global $current_user; get_currentuserinfo(); return $current_user; } $member_online = $user_ID; echo $member_online; ?> $user_ID is a string that is part of $current_user.
  2. Thanks, But no, the echo prints the value just fine in IE but a blank screen in Safari! It just isn't finding the value in Safari or Firefox and I don't understand why!
  3. Thanks for your help TeddyKiller! Unfortunately that does not help either! I believe the $current_user global is set in the Wordpress pluggable.php file. Here is the code: (again I believe....somewhat new to this) function wp_set_current_user($id, $name = '') { global $current_user; if ( isset($current_user) && ($id == $current_user->ID) ) return $current_user; $current_user = new WP_User($id, $name); setup_userdata($current_user->ID); do_action('set_current_user'); return $current_user; } endif; if ( !function_exists('wp_get_current_user') ) : Again, the code I used in first post works in IE great!! It is just Safari and FireFox that it doesn't?? The same is true if I try to call the Wordpress Login Cookies. Works in IE but not Safari or Firefox. It just doesn't seem to find it like I have not connected to Wordpress somehow! Any help is appreciated! Thanks!
  4. I know this has to do with Wordpress as well, but I have not had much luck with Wordpress Forums like I have this one. I have a custom page that works with the Wordpress P2 theme. I need to get the global variable $current_id. I have used the following code, and it works great in IE but doesn't show anything in Safari or FireFox. There are no errors, but it is blank. So it is not retrieving the Global variable. <?php require_once '../wp-config.php'; global $current_user; get_currentuserinfo(); $member_online = $user_ID; ?> Any suggestions!! Thanks!
  5. Mchl was correct!! Once I took mysql_query out it worked! Now, how do I get it to round to the nearest whole number? Right now I it comes out as 8.333 but I would like it to be 8. Thank everyone for the quick help!
  6. Thank you, I made changes according to your post and I get this message? 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 'Resource id #27' at line 1 Any suggestions! Thank you!!
  7. Hello All, New to PHP FREAKS! I am trying to get an average of a column in a database. The column is called "product_quality". I also have a column called "cust_id" that is the customer id's. When I get the average I want it to be for just a certain customer id. I thought I had the code correct but it isn't printing it out right. Here is what I have! <? //connect to mysql //change user and password to your mySQL name and password mysql_connect("localhost","user","password"); //select which database you want to edit mysql_select_db("voogahco_microblog"); $search="$id"; //get the mysql and store them in $result //change whatevertable to the mysql table you're using //change whatevercolumn to the column in the table you want to search // Make a MySQL Connection $query = mysql_query("SELECT AVG(customer_service) FROM rating WHERE cust_id LIKE '$search'"); $result = mysql_query($query) or die(mysql_error()); echo $result ?> Any help would be appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.