PHP - Reporting New Activity
Hello everyone,
I have a messaging site where I have an email generated every night to report new activity on my site. The way it is currently set up, I have each message reply attached to the previous message, such as quoting the original text in an email message. Each string of messages in my database has one common field ("string"), but each new reply has a different message ID field in the database ("messid"). When each new message and reply is created the "reported" field in my database has a default value of n, meaning that it has not been reported yet. At the end of the day, when the email is generated, the reported field is then updated to y, meaning that it HAS been reported. The problem that I'm having now, is that I'm getting several of the same messages in every report. I am using the following code to select each unreported message from the database to generate my report: Code: [Select] <?php $result = mysql_query("SELECT `to`,`studentname`,`staffname`,`subject`,`message`,`date` FROM caresa6_$acct.allmsgs WHERE reported = 'n' ORDER BY `messid` ASC") or die (mysql_error()); ?> Basically, I need to know how to select only the most recent unreported message within each string of messages. For example, now if there is a new message: "Hello there." Then a reply from the recipient: "Hi! How are you?" Then another reply from the original sender: "I am fine." My report will look like this: ___________ New Message: "Hello there." ------------------ Reply: "Hi! How are you?" ------------------ Reply: "I am fine." ------------------ ___________ New Message: "Hello there." ------------------ Reply: "Hi! How are you?" ------------------ ___________ New Message: "Hello there." ------------------ So I am getting carbon copies of every new message every time someone replies. I want to only select the most recent message so that my report only reads: ___________ New Message: "Hello there." ------------------ Reply: "Hi! How are you?" ------------------ Reply: "I am fine." ------------------ Thanks in advance. Similar TutorialsHi, when a user logs out, I want to store the last activity in for the user. I have a db table users: userID userName userPassword lastSession lastActivity ===== ======= ========== ======== ======= 1 bob password 2011-08-09 About.html 2 dre passwords 2011-09-23 Home.php here is logout script: =============== Code: [Select] <?php //run this script only if the logout button has been clicked if(array_key_exists('logout', $_POST)) { require("connect.inc"); $username=$_POST["username"]; $updateLastSessionQuery=mysql_query("UPDATE users SET lastSession=NOW() WHERE userName='$username'"); // end session and redirect //empty the $_SESSION array $_SESSION = array(); session_destroy(); header("Location: xmlShredderLogin.php"); exit; }//END IF for when logout submitted ?> here is Index.php: ============= Code: [Select] <?php session_start(); if(isset($_SESSION["isAuthenticated"])) { require("logout.inc.php"); $username=$_POST["username"]; //print $username."<br />"; print ' <html> <head><title>Home</title></head> <body> <form id="logoutForm" name="logoutForm" method="post" action=""> <input name="logout" type="submit" id="logout" value="Log out" /> <input type="hidden" name="usernameHidden" value='; print$username; print '/> </form>'; mysql_connect("localhost","root"); mysql_select_db("someDB"); $getUserInfoQuery=mysql_query("SELECT lastSession,lastActivity FROM users WHERE userName='$userName'"); $getUserInfo=mysql_fetch_assoc($getUserInfoQuery); print "Last session: ".$getUserInfo["lastSession"]."<br />"; print "Last activity: ".$getUserInfo["lastActivity"]."<br />"; Let's say the last page the user is on is Index.php, so what do I use to track the last page they are on?? I can't user a form b/c if I have to type in the last activity, that's nonsense! So far I have only figured out how to store the current time in last session (but this doesn't work either). I just want to track the last page and then have a switch such as: switch(type) case 1: $lastActivity="About.html"; case 2: $lastActivity="somethingelse.php"; Any help much appreciated! I added some code last night that updates the "last_activity" field in the "member" table whenever the "body_header.inc.php" script is called, which means that pretty much whenever the User navigates to a new page or submits a form this field is updated. (I use this to kep my "User Online Status" up-to-date.) Everything was working fine until I suddenly started getting a "Cannot modify header" error before bed. Here is ONE sequence causing this error... - I am logged out - I am on http://local.debbie/index.php - I click on the "Log In" link - I am taken to http://local.debbie/members/log_in.php - I log in - I get this error... Quote Warning: Cannot modify header information - headers already sent by (output started at /Users/user1/Documents/DEV/++htdocs/05_Debbie/index.php:22) in /Users/user1/Documents/DEV/++htdocs/05_Debbie/components/body_header.inc.php on line 48 Here is part of my main index.php script... <?php //Build Date: 2012-03-08 // Initialize a session. session_start(); // Access Constants. require_once('config/config.inc.php'); // Set current Script Name. $_SESSION['returnToPage'] = $_SERVER['SCRIPT_NAME']; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- ################## DEBBIE ##################### --> <!-- HTML Metadata --> <title>Double Dee, Inc.</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- Page Stylesheets --> <link type="text/css" rel="stylesheet" href="css/_main.css" /> <link type="text/css" rel="stylesheet" href="css/_layout.css" /> <link type="text/css" rel="stylesheet" href="css/top_menu.css" /> <link type="text/css" rel="stylesheet" href="css/components.css" /> </head> <body> <div id="pageWrapper" class="clearfix"> <div id="pageInner"> <!-- BODY HEADER --> <?php require_once('components/body_header.inc.php'); ?> <!-- LEFT COLUMN --> <div id="pageLeftCol"> Here is a snippet from my body_header.inc.php script... <?php //Build Date: 2012-03-08 // ************************ // Update Last Activity. * // ************************ if ((isset($_SESSION['loggedIn'])) && ($_SESSION['loggedIn'] == TRUE)){ // Initialize Session. // session_start(); // Access Constants. // require_once('../config/config.inc.php'); // Initialize variables. $loggedIn = TRUE; $memberID = (isset($_SESSION['memberID']) ? $_SESSION['memberID'] : ''); // ************************ // Update Member Record. * // ************************ // Connect to the database. require_once(WEB_ROOT . 'private/mysqli_connect.php'); // Build query. $q1 = "UPDATE member SET logged_in=?, last_activity=now() WHERE id=? LIMIT 1"; // Prepare statement. $stmt1 = mysqli_prepare($dbc, $q1); // Bind variables to query. mysqli_stmt_bind_param($stmt1, 'si', $loggedIn, $memberID); // Execute query. mysqli_stmt_execute($stmt1); // Verify Update. if (mysqli_stmt_affected_rows($stmt1)!==1){ // Update Failed. $_SESSION['resultsCode'] = 'MEMBER_UPDATE_FAILED_2126'; // Redirect to Display Outcome. header("Location: " . BASE_URL . "members/results.php"); // End script. exit(); }//End of UPDATE MEMBER RECORD // Close prepared statement. mysqli_stmt_close($stmt1); // Close the connection. mysqli_close($dbc); /* */ }//End of UPDATE LAST ACTIVITY /* // Determine Current Script. $page = basename($_SERVER['REQUEST_URI']); if ($page == '') { $page = "index.php"; } */ // Determine Script Name. $scriptName = $_SERVER['SCRIPT_NAME']; ?> <!-- PAGE HEADER --> <div id="pageHeader"> <!-- COMPANY BRANDING --> <h1 id="companyLogo"> <!-- Display Logo if "Images On" --> <a href="/index.php"> <!-- Image Replacement Technique --> <span></span> </a> <!-- Display Text if "Images Off" --> DoubleDee, Inc: Tips on starting a Small-Business </h1> <!-- WELCOME MESSAGE --> <?php $firstName = (isset($_SESSION['memberFirstName']) ? $_SESSION['memberFirstName'] : ''); I was mindful of extra white space possibly causing the issue, but I don't see where it is?! The "Update Last Activity" code was added to my Header last night and is likely the culprit... Any ideas what is wrong?? Thanks, Debbie Hey all, Quick sum up: I have a social website where users can follow/post/vote etc. I am adding a new facebook-like activity wall feature to each users profiles. I have worked on this bit for a few days now and can't seem to get it to work properly. What I want is, well, exactly like the facebook wall as I mentioned...When a visitor visits a user's profile, that user's activity will display, whether they recently "voted" on a post, commented, or posted something of their own, I would like it to display on their profile and of course, have the most recent entries on top. The problems I am having right now a it's displaying some things twice and it's not sorting them by the most recent. I am working with 3 tables here (I only posted the columns that I am using): Code: [Select] Table structure for table votes_posts Field Type Null Default indexer int(11) No post_id int(11) No vote int(11) No user_name varchar(250) No date varchar(255) No Table structure for table posts Field Type Null Default id int(11) No name varchar(30) No content text No datetimerss varchar(255) No category int(11) No Table structure for table comments Field Type Null Default id int(12) No post_id int(12) No name varchar(30) No content text No type varchar(30) No datetimerss varchar(255) No $users is just $_GET['user'] The timeAgo() function, simply displays the very popular "posted xx ago" date time. <ul class="streamActivity"> <?php $checkActivity = "SELECT votes_posts.post_id, votes_posts.user_name, votes_posts.vote, votes_posts.date, posts.id, posts.content, posts.name, posts.datetimerss, categories.category, comments.post_id AS comm_postid, comments.content AS comm_content, comments.name AS comm_name, comments.datetimerss AS comm_date, comments.type FROM `votes_posts` LEFT OUTER JOIN `posts` ON votes_posts.post_id = posts.id LEFT OUTER JOIN `comments` ON posts.id = comments.post_id LEFT OUTER JOIN `categories` ON posts.category = categories.cat_id WHERE (votes_posts.post_id = posts.id AND user_name = '$user') OR (comments.post_id = posts.id AND comments.name = '$user') OR (posts.name = '$user') ORDER BY votes_posts.date, posts.datetimerss, comments.datetimerss ASC"; $checkActivityResult = mysql_query($checkActivity); if (mysql_num_rows($checkActivityResult) > 0) { while ($sessionAct = mysql_fetch_array($checkActivityResult)) { $category = strtolower($sessionAct['category']); $dateVote = timeAgo($sessionAct['date']); $datePost = timeAgo($sessionAct['datetimerss']); $dateComm = timeAgo($sessionAct['comm_date']); $namePost = $sessionAct['name']; $nameComm = $sessionAct['comm_name']; $nameVote = $sessionAct['user_name']; $idVote = $sessionAct['post_id']; $idPost = $sessionAct['id']; $idComm = $sessionAct['comm_postid']; $contentPost = $sessionAct['content']; $contentComm = $sessionAct['comm_content']; $typeComm = $sessionAct['type']; if ($namePost == $user) { $classList = 'storyPost'; $classIcon = 'iconMuttr'; $name = $namePost; $content = $contentPost .' ... read more'; $datetime = $datePost; } elseif ($nameComm == $user && $typeComm == "Comment") { $classList = 'actionPost'; $classIcon = 'iconComment'; $name = $nameComm; $content = 'Commented "'. $contentComm .'"'; $datetime = $dateComm; } elseif ($nameComm == $user && $typeComm == "Advice") { $classList = 'actionPost'; $classIcon = 'iconAdvice'; $name = $nameComm; $content = 'gave Advice "'. $contentComm .'"'; $datetime = $dateComm; } elseif ($nameVote == $user) { if ($sessionAct['vote'] == "1") { $classList = 'actionPost'; $classIcon = 'iconLaughed'; $name = $nameVote; $content = 'Laughed at "'. $contentPost .'"'; $datetime = $dateVote; } elseif ($sessionAct['vote'] == "2") { $classList = 'actionPost'; $classIcon = 'iconLoved'; $name = $nameVote; $content = 'Showed Love on "'. $contentPost .'"'; $datetime = $dateVote; } elseif ($sessionAct['vote'] == "3") { $classList = 'actionPost'; $classIcon = 'iconIdiot'; $name = $nameVote; $content = 'called '. $namePost .' an Idiot for "'. $contentPost .'"'; $datetime = $dateVote; } } ?> <li class="row-activity <?php echo $classList; ?>"> <a href="" class="avatar"><img src="/images/avatars/default_male.jpg" /></a> <div class="info"> <div class="userName"> <a href=""><?php echo $name; ?></a> </div> <span class="msgBody"><?php echo $content; ?></span> <div class="imgTimeStream"> <span class="img <?php echo $classIcon; ?>"></span> <span class="source"><?php echo $datetime; ?></span> </div> </div> </li> <?php } } else { echo '<p>This user has no recent activity.</p>'; } ?> </ul> I am by no means an expert programmer...everything I know I have pretty much taught myself over the past year or two, so I can only imagine how ugly this truly is lol. I am learning each and everyday though, and I hope to continue Also, within each type of activity, there will be slightly different CSS classes on some things. Example: if the result row is a post then the css class of the list item would be "post" if the result row is a vote then the css class of the list item would be "vote" etc. Any help would be appreciated! hey all,
I've finally took a leap towards the brighter side of coding.. and Ive started to convert my code from php to opp pdo ect..
However the errors Ive been through my cms's and well anything to do with inserting into a database is rather confusing..
ERRORS such as invalid parameter number,.
What does this mean?
Here's the code that im getting the error from:
<?php //if form has been submitted process it if(isset($_POST['submit'])){ $_POST = array_map( 'stripslashes', $_POST ); //collect form data extract($_POST); //very basic validation if($title ==''){ $error[] = 'Please enter the title.'; } if($short_desc ==''){ $error[] = 'Please enter a short description.'; } if($full_desc ==''){ $error[] = 'Please enter a full description.'; } if(!isset($error)){ try { //insert into database $stmt = $handler->prepare('INSERT INTO calendar_event (title,short_desc,full_desc,date) VALUES (:title, :short_desc, :full_desc, :date)') ; $stmt->execute(array( ':title' => $title, ':short_desc' => $short_desc, ':ful_desc' => $full_desc, ':date' => date('Y-m-d') )); //redirect to index page header('Location: index.php?action=added'); exit; } catch(PDOException $e) { echo $e->getMessage(); } } } //check for any errors if(isset($error)){ foreach($error as $error){ echo '<p class="error">'.$error.'</p>'; } } ?> <form action='' method='post'> <table class="admin_table_defaults"> <tr> <th width="10px">Title</th> <th width="200px">Date</th> <th width="200px"> </th> <th></th> </tr> <tr> <td><input type='text' name='title' value='<?php if(isset($error)){ echo $_POST['title'];}?>'></td> <td><input type='date' name='date' value='<?php if(isset($error)){ echo $_POST['date'];}?>'></td> <td><td> </tr> </table> <table class="admin_table_defaults"> <tr> <th style="text-align:left;"> Short Description <span class="small_text"> : NB - Please avoid using images, align properties, stick to text format. <br/><b style="background:#fff;font-size:14px;">Note : There's a character max of 100 characters for this field</b></span></th> </tr> <tr> <td><textarea name='short_desc' cols='60' rows='10' ><?php if(isset($error)){ echo $_POST['short_desc'];}?></textarea></td> </tr> <tr> </table> <table class="admin_table_defaults"> <tr> <th style="text-align:left;"> Full Description: <span class="small_text"></th> </tr> <tr> <td><textarea name='full_desc' cols='60' rows='10'><?php if(isset($error)){ echo $_POST['full_desc'];}?></textarea></td> </tr> <tr> <td><input class="admin_submit_btn"type='submit' name='submit' value='Submit'></td> </tr> <tr> </table> </tr> </table> </form>Any help will be greatly appreciated Thanks in advance.. I want to log my errors to a log file but it isn't working. I get the error displayed on the screen but the file is not written to. The file permissions are set to 777 to make things easy. Error reporting is on for development only. Any advice on why I cannot write to the file? It's an apache server. Is there a trick to getting the file path correct relative to my front controller? Also, if I use error_log to send the error to my email address, it works. ini_set('error_reporting', E_ALL | E_STRICT); ini_set('display_errors', true); error_log("You messed up!", 3, '/var/www/vhosts/domain.com/httpdocs/framework/errors.txt'); This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=326408.0 im getting this error when i run a script mysql_query(): supplied argument is not a valid MySQL-Link resource what do i have to do to echo out the actual error and what line its on like this Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/www/ikhelper.freehostia.com/globinc/loginfunc.php on line 87 iv tried inserting error_reporting(E_ERROR | E_WARNING | E_PARSE); and error_reporting(-1); but doesnt output any error When I use ini_get to check my error_reporting level, I get a weird value ( 4983 ) that I can't find anywhere by googling. Also not on the list of possible levels here ( http://itech.hubpages.com/hub/php-error_reporting ) .. does anyone know how to determine what exactly this level is? Thanks! Hi Guys Completely Stuck by this one. Using the code below, when I go to the page I am getting a completely blank page (even though I have Error Reporting on. Can anybody tell me where I have gone wrong? Code: [Select] <?php ini_set ('display_errors', 1); error_reporting(E_ALL); ?> <?php session_start(); include_once('includes/connect_inc.php'); include_once('functions/reg_functions.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/trade-bidz.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <!-- InstanceBeginEditable name="doctitle" --> <title>Trade-Bidz Coming Soon...</title> <!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> <link href="style/trade-bidz.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" language="JavaScript"> <!-- Copyright 2006,2007 Bontrager Connection, LLC // http://bontragerconnection.com/ and http://www.willmaster.com/ // Version: July 28, 2007 var cX = 0; var cY = 0; var rX = 0; var rY = 0; function UpdateCursorPosition(e){ cX = e.pageX; cY = e.pageY;} function UpdateCursorPositionDocAll(e){ cX = event.clientX; cY = event.clientY;} if(document.all) { document.onmousemove = UpdateCursorPositionDocAll; } else { document.onmousemove = UpdateCursorPosition; } function AssignPosition(d) { if(self.pageYOffset) { rX = self.pageXOffset; rY = self.pageYOffset; } else if(document.documentElement && document.documentElement.scrollTop) { rX = document.documentElement.scrollLeft; rY = document.documentElement.scrollTop; } else if(document.body) { rX = document.body.scrollLeft; rY = document.body.scrollTop; } if(document.all) { cX += rX; cY += rY; } d.style.left = (cX+10) + "px"; d.style.top = (cY+10) + "px"; } function HideContent(d) { if(d.length < 1) { return; } document.getElementById(d).style.display = "none"; } function ShowContent(d) { if(d.length < 1) { return; } var dd = document.getElementById(d); AssignPosition(dd); dd.style.display = "block"; } function ReverseContentDisplay(d) { if(d.length < 1) { return; } var dd = document.getElementById(d); AssignPosition(dd); if(dd.style.display == "none") { dd.style.display = "block"; } else { dd.style.display = "none"; } } //--> </script> </head> <body> <div id="header"> <div id="login_form"> <?php //if(!isset($_SESSION['logname'])) //{ //include_once('includes/mini_login_inc.php'); //} //else //{ //include_once('includes/logout_inc.php'); //} ?> </div> <img src="images/logo.jpg" width="300" /></div> <div id="nav_head"><ul><li>Buying</li><li>Selling</li><li>Contact Us</li><li>Terms</li><li>My Trade-Bidz</li></ul></div> <div id="content"><!-- InstanceBeginEditable name="content" --> <form name="add_lot" action="add_vehicle.php" method="post"> <table> <tr><td>Reg Number</td><td><input name="veh_reg" width="10" maxlength="10"/><img src="images/search_glass.jpeg" width="50" onclick="getVehData()" /> <?php if (isset($message)) { echo ('<br />'.$message.); } ?> </td></tr> </table> </form> </body> <!-- InstanceEnd --></html> Hi , Presently we are preparing an excel for download report by querying to data base. We are querying to DB and looping through each result row and writing to excel. for 2lacs data its too much time. I found the time taken max in DB query and processing the DB data . Ant way I can make it faster ? Any parallel processing I can apply to get it faster......I expecting Huge data report in future. I have been working on this awhile (the perfect PHP error handling for my coding style). I have tried to set it up as: Code: [Select] <?php error_reporting(E_ALL & E_STRICT & ~(E_NOTICE)); ?> I want this to show me E_ALL errors, E_STRICT errors, and NOT show me E_NOTICE. Is this the right way to set that up, or am I doing something wrong. I haven't used E_STRICT before but I am anxious to see what kind of errors that have it showing since I haven't messed with it before. Thanks again. My form Code: [Select] <form action="process.php" method="post"> <font face= "calibri" size= "4"> <table border= "1"> <tr style= "background: #cccccc"> <td><b>Item Description:</b></td> <td><input type= "text" name= "itemDescription" size= "30" value=""/></td> </tr> <tr style= "background: #99ff00"> <td><b>Item Price:</b></td> <td><input type= "text" name= "itemPrice" size= "5" value=""/></td> </tr> </tr style= "background: #A8E5FF"> <td><b>Winning Bidders:</b></td> <td><input type="text" name= "winningBidder" size= "5" /> </td> </tr> <tr> <td><b>How many deals?:</b></td> <td><input type="text" name= "itemQty" size= "3" value= "1" /></td> </tr> </table> <br/> <input type="reset" value="Reset Form"><input type="submit" name="submit" value= "Save & Cont." " /> </form></font> My process script: Code: [Select] <?php error_reporting(E_ALL); ini_set("display_errors", 1); $host= ""; $db_name= ""; $db_user= ""; $db_password= ""; $logUser= $_POST['logUser']; $deleteBidder = $_POST['deleteBidder']; $newBidder= $_POST['newBidder']; $itemDescription= $_POST['itemDescription']; $itemPrice= $_POST['itemPrice']; $winningBidder= $_POST['winningBidder']; $itemQty= $_POST['itemQty']; ob_start(); if ($_POST['newBidder']) { $bidderId= $newBidder; mysql_connect("$host", "$db_user", "$db_password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM bidders WHERE biddersId='$bidderId'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==0){ // Add $biddersId and redirect to anypage mysql_Query("INSERT INTO bidders (biddersId) VALUES ('$bidderId')"); header("Location: index.php"); exit(); } } if ($_POST['deleteBidder']) { mysql_connect("$host", "$db_user", "$db_password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); mysql_query("DELETE FROM bidders WHERE biddersId='$deleteBidder'"); header("Location: index.php"); exit(); } if ($_POST['itemDescription'] AND $_POST['itemPrice'] AND $_POST['winningBidder'] AND $_POST['itemQty']) { mysql_connect("$host", "$db_user", "$db_password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM transactions WHERE biddersId='$winningBidder'"; $result=mysql_query($sql); $count=mysql_num_rows($result); // If result matched, table row must be 1 row if($count==0){ echo "That Bidder Number is NOT logged in, "; echo "would you like to set this bidder as active?"; echo " Enter 1 for NO or 2 for YES"; echo "<form action= \"process.php\" method= \"POST\">"; echo "<input type =\"text\" name= \"logUser\"/>"; echo "<input type= \"submit\" value = \"Submit\"/>"; $logUser= $_POST['logUser']; exit(); } if ($logUser= 1) { header("Location: inprogress.php"); exit(); } else if ($logUser= 2){ // Add $biddersId and redirect to anypage mysql_connect("$host", "$db_user", "$db_password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); mysql_Query("INSERT INTO bidders (biddersId) VALUES ('$winningBidder')"); mysql_query("INSERT INTO transactions (itemDescription, itemPrice, bidderId, itemQty , totalPrice) VALUES('$itemDescription', '$itemPrice','$winningBidder', '$itemQty', '$totalPrice')") or die(mysql_error()); $_SESSION['itemDescription']='$itemDescription'; header("Location: index.php"); exit(); } } echo "<font color= \"red\" face=\"calibri\" size=\"4\">That bidder is already logged, Please press your browsers back button and try again.</font>"; ob_end_flush(); ?> DeleteBidder and newBidder are the only variables working? I am using the classic Code: [Select] ini_set("display_errors","2"); ERROR_REPORTING(E_ALL); but I am getting a notice that is posting on my page. I preffer not to remove the reporting yet since the site is still new and is there any way I can hide the notice but keep the fail errors the error is Code: [Select] Notice: Undefined index: HTTPS in /var/www/website/visitors.php on line 20 line 20 is Code: [Select] if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";} I am trying to echo out an array from my data base. I think I have my function created correctly: Noted below is the snippet from my transaction.class.php file Code: [Select] <?php //Retreives data from the database public function retrieve_all_data($TransactionDate=0, $TransactionType=0, $TransactionAmount=0, $CurrentBalance=0){ $accounts_query = "SELECT TransactionDate, TransactionType, TransactionAmount, CurrentBalance FROM BankAccount, TransactionType, TransactionLog = " . $this->accountid ." LIMIT 0,30"; $result = mysqli_query($this->connection, $accounts_query); return $result; } ?> I try to echo out using this format but I am not having any luck. Code: [Select] <?php /*Accounts*/ $currentMember->connection = $conn; $accounts = $currentMember->retrieve_all_data(); /*Loop through account - Grabs data*/ while($account = mysqli_fetch_assoc($accounts)){ /*Retrieve Balance*/ $transaction = new Transaction($account['TransactionDate'], $account['TransactionType']); $transaction->connection = $conn; //$balance = mysqli_fetch_assoc($transaction->retrieve_current_balance()); echo '<tr>' . "\n"; echo "\t" . '<td>' . $account['TransactionDate'] . '</td>' . "\n"; echo "\t" . '<td>' . $account['TransactionType'] . '</td>' . "\n"; echo '<tr>' . "\n"; } /*Close DB*/ mysqli_close($db->connection); ?> Hi,
Can anyone recommend some Business Intelligence tools that can be integrated into a PHP (wordpress/joomla) based website? I've had a good look around the net but they all seem to be written in Java/J2EE and appear to be software based - not sure if im after the possible or impossible here...
Thanks
|