Jump to content

everlifefree

Members
  • Posts

    112
  • Joined

  • Last visited

    Never

Everything posted by everlifefree

  1. OK, here the working code I have now: // COUNT ALL VIDEO POSTS /////////////////////////////////////////////////////////// $selectCount = myQ("SELECT SQL_CALC_FOUND_ROWS * FROM `[x]video` WHERE `user`='".me('id')."' "); $countRowsSelectCount = myQ("SELECT FOUND_ROWS()"); $countRowsResultCount = mysql_fetch_row($countRowsSelectCount); $totalRowsCount = $countRowsResultCount[0]; $tpl -> AssignArray(array( "video.total" => $totalRowsCount, )); But I would like to make it so I can count 7 different things and I believe the array and everything will get mixed up unless I change each one a little bit. Please Help Let Me Know What I Need To change sorta like: $totalRowsCount = $countRowsResultCount[0]; is changed to $totalRowsCountG = $countRowsResultCountG[0]; or something like that... One example of the 7 different things you could use this one to show me what I need to change and all // COUNT ALL GALLERY POSTS /////////////////////////////////////////////////////////// $selectCount = myQ("SELECT SQL_CALC_FOUND_ROWS * FROM `[x]gallery` WHERE `user`='".me('id')."' "); $countRowsSelectCount = myQ("SELECT FOUND_ROWS()"); $countRowsResultCount = mysql_fetch_row($countRowsSelectCount); $totalRowsCount = $countRowsResultCount[0]; $tpl -> AssignArray(array( "gallery.total" => $totalRowsCount, ));
  2. I tried both and neither worked one gave me nothing and the other return a 1 aswell was I supposed to put something special in the something spot?
  3. Here's the new code I tried: // COUNT VIDEO POSTS /////////////////////////////////////////////////////////// $query = mysql_query("SELECT COUNT(*) AS total FROM `[x]videos` WHERE `user`='".me('id')."' $result = mysql_fetch_assoc($query); $tpl -> AssignArray(array( "video.total" => $result, )); But I get this error: Parse error: syntax error, unexpected T_STRING in /home/sites/spadespace.com/public_html/modules/users/desktop.php on line 227 And line 227 is one of these two: $query = mysql_query("SELECT COUNT(*) AS total FROM `[x]videos` WHERE `user`='".me('id')."' $result = mysql_fetch_assoc($query);
  4. ok, thanks last quest is do I need to input any into the "(id field of the table)" part or is that whats supposed to be there?
  5. I just reliezed a flaw in my code of the first post it should actually be like this but I still have the same problem. // COUNT VIDEO POSTS /////////////////////////////////////////////////////////// $selectCount = myQ("SELECT SQL_CALC_FOUND_ROWS * FROM `[x]videos` WHERE `user`='".me('id')."' "); $countRowsSelectCount = myQ("SELECT FOUND_ROWS()"); $countRowsResultCount = mysql_fetch_row($countRowsSelectCount); $totalRowsCount = $countRowsResultCount[0]; $tpl -> AssignArray(array( "video.total" => $totalRowsCount, "dbCount.sample" => $totalRows, ));
  6. If I am think right then my id area counts up 1 for the first post ever by anyone and then 2 for the second post anyone ever posted and so on how exactly would I implent this is it's the right thing?
  7. would anyone mind writing the code the use with my variables in it because I am a little confused where to insert them.
  8. Ok here's the code I have come up with so far and what I'd like to be able to do is count the number of posts by each user. The querys I would like to use out of the videos table to count them is: user. But currently all I can get it to count to is 1. So I know I did something wrong. Please Help... // COUNT ALL USERS /////////////////////////////////////////////////////////// $selectCount = myQ("SELECT SQL_CALC_FOUND_ROWS * FROM `[x]videos` WHERE `user`='{$_GET["id"]}' "); $countRowsSelectCount = myQ("SELECT FOUND_ROWS()"); $countRowsResultCount = mysql_fetch_row($countRowsSelectCount); $totalRowsCount = $countRowsResultCount[0]; $tpl -> AssignArray(array( "video.total" => $totalRowsCount, "dbCount.sample" => $totalRows, ));
  9. I add your code and these are the errors that showed but these all showed before I started try to add all this. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sites/spadespace.com/public_html/system/functions/database/mysql.fnc.php on line 37 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/sites/spadespace.com/public_html/system/functions/database/mysql.fnc.php on line 37 Notice: Undefined variable: contactsCount in /home/sites/spadespace.com/public_html/modules/users/profile.php on line 625
  10. So your sure it's not just the sessions or its missing some of the code that would cause it to work.
  11. Ya, it was a developer script I installed and I'm try to change a few things
  12. Whats the code look like with that?
  13. Ok I have a report button on several pages that uses this php code: elseif (isset($_GET["mode"]) and $_GET["mode"] == "rp") { $select = myQ(" UPDATE `[x]gallery` SET `isbroken` = '1' WHERE `id` = '{$_GET["id"]}' "); $select = myQ(" SELECT SQL_CALC_FOUND_ROWS * FROM `[x]gallery` WHERE `processed` = '1' ORDER BY `date` DESC LIMIT ".(($page * $CONF["EZINE_SEARCH_RESULTS_PER_PAGE"]) - $CONF["EZINE_SEARCH_RESULTS_PER_PAGE"]).",{$CONF["EZINE_SEARCH_RESULTS_PER_PAGE"]} "); } but when I tried to add it to a different page that doesn't have all the other get things before it. It doesn't work. Here the coded I changed it to and added. elseif (isset($_GET["mode"]) and $_GET["mode"] == "rp") { $select = myQ(" UPDATE `[x]users` SET `isbroken` = '1' WHERE `id` = '{$_GET["id"]}' "); } Anybody know the correct way I could add this and have it work with out the extra?
  14. sorry what?
  15. Still need help nothings worked yet!
  16. it's set in my conf.inc.php file
  17. $_SESSION["profile_view"] = $row["id"]; it went away when I added a } after it but it still doesn't work
  18. I tried that but it doesn't allow you to change the page name depending on the page.
  19. That just created this error: Parse error: syntax error, unexpected $end in /home/sites/spadespace.com/public_html/modules/users/profile.php on line 1171
  20. when I visit the page everything runs fine but it doesn't add any pageviews to my database like it is supposed to so pretty much I have code sitting there doing nothing, when I need to be add page views
  21. Ok I have a report button on several pages that uses this php code: elseif (isset($_GET["mode"]) and $_GET["mode"] == "rp") { $select = myQ(" UPDATE `[x]gallery` SET `isbroken` = '1' WHERE `id` = '{$_GET["id"]}' "); $select = myQ(" SELECT SQL_CALC_FOUND_ROWS * FROM `[x]gallery` WHERE `processed` = '1' ORDER BY `date` DESC LIMIT ".(($page * $CONF["EZINE_SEARCH_RESULTS_PER_PAGE"]) - $CONF["EZINE_SEARCH_RESULTS_PER_PAGE"]).",{$CONF["EZINE_SEARCH_RESULTS_PER_PAGE"]} "); } but when I tried to add it to a different page that doesn't have all the other get things before it. It doesn't work. Here the coded I changed it to and added. if (isset($_GET["mode"]) and $_GET["mode"] == "rp") { $select = myQ(" UPDATE `[x]users` SET `isbroken` = '1' WHERE `id` = '{$_GET["id"]}' "); "); } Anybody know the correct way I could add this and have it work with out the extra?
  22. Ok I have this code that works great where it is now but when I try to add it to other pages it won't work. Here is the original code: /* Update video data; views count */ if (!isset($_SESSION["video_view"]) or (isset($_SESSION["video_view"]) and $_SESSION["video_view"] != $row["id"])) { myQ("UPDATE `[x]video` SET `views` = `views` + '1' WHERE `id`='{$row["id"]}'"); $_SESSION["video_view"] = $row["id"]; And here's my changed code: /* Update user data; views count */ if (!isset($_SESSION["profile_view"]) or (isset($_SESSION["profile_view"]) and $_SESSION["profile_view"] != $row["id"])) { myQ("UPDATE `[x]users` SET `views` = `views` + '1' WHERE `id`='{$row["id"]}'"); $_SESSION["profile_view"] = $row["id"]; Anybody know why it isn't working?? My guess is something to do with the sessions but I don't know what to change. Please Help...
  23. That didn't work
×
×
  • 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.