I want to send an email only if the field name 'Active' has changed in my database table bus_status.. It is a boolean field (TRUE or FALSE) so if it is False and changes to TRUE upon update I want it to send the email or if is TRUE and it is changed to false on update then I want it to send the email. This code was placed into a HOOK file that has a function started called After_Update which is triggered after the record is changed. If I just remove the first two lines of this code it …

Member Avatar
Member Avatar
+0 forum 1

Hello, I want to make a conditional SQL. I have one table "users" and it has two columns (id, status) I need to search for users IDs based on their status. For example. Every 5 seconds I am querying from the database (by AJAX) as per the below description: Let us say that I have the below results on my wall (on html): id1: 1 status2: "A" id2: 2 status2: "B" I need to get IDs from table "users" but exclude the IDs from database if their statuses haven't changed on my wall. So the algorithm should be: Get all …

Member Avatar
Member Avatar
+0 forum 1

Hi! Need help with conditional formatting of table rows... What i need to acheave is to change table row background in red if date_needed is <= than 48 hours than now(). This is what i have now `if (date('d',strtotime($data['date_needed'])) <= 2) $row["rowstyle"]='style="background:red"';` it works in a way... It changes background color for 1. and 2. of the month, but that is not what i need... Must mark rows where dedline is less or equal to 48 hours. Thank you!

Member Avatar
Member Avatar
+0 forum 4

is it possible in php java scrip and jquery that we give a condition and redirect page to another pages on depending on those condition like if($id==1) { header(location:page1.php); } else { header(location:page2.php); } the value of id comes from database. something like that using jc jquery enything please help its argent.

Member Avatar
Member Avatar
+0 forum 2

Hello all: I have the following mysql query statement: SELECT COUNT(*) as ttl_rows FROM (SELECT DISTINCT(date(timeentry)) AS day, COUNT(*) AS total FROM history where MONTH(CAST(timeentry as date)) = MONTH(NOW()) AND YEAR(CAST(timeentry as date)) = YEAR(NOW()) GROUP BY DATE_FORMAT(timeentry, '%d') ASC) as ttl_row the statement performs a search for all records entered for the current month and thus would produced the following: day total 2012-12-01 1 2012-12-02 6 2012-12-04 4 2012-12-05 3 As you can see, there is no record for 2012-12-03. My interest here is to modify the query to return all dates with the date range and where there …

Member Avatar
Member Avatar
+0 forum 6

This is the second part of a script. It gets the EAN from the form in the first part. Where there are sales, it will show total number but if not I want to show a message to say "none" or "No Sales". Don't quite get the else/if errors. Could someone suggest what I've done wrong. <?php include 'db.php'; $term = $_POST['EAN']; $term = TRIM($term); $sql = mysql_query("SELECT Name, Brand, EAN, sum(orderedquantity) As SumS FROM $salesdb WHERE EAN LIKE '%$term%' Limit 0,5"); while ($row = mysql_fetch_array($sql)) { if($row['SumS'] <'1') { Print '<table style="width:100%;margin-left:auto;margin-right:auto" border=1><font face=arial size=2 > <tr><td>Sales 2012:<b>"None Sold"</b></td></tr></table>'; …

Member Avatar
Member Avatar
+0 forum 2

My code does not work in certain versions of IE and I want to include a conditional comment that includes a different navigation file so that links to pure html5 content wont be there. is there a way to remove the include of the menu.php and then i can just include the IE menu.php? I know how to do the conditional comment, and include, just looking for a way to do a remove file.

Member Avatar
Member Avatar
+0 forum 2

hello everyone, I am recieving this compiler error stating that `else if(input%100 || input%10 == rndNum%100 || rndNum%10)` this line ^ gives me the error error: bad operand types for binary operator '||' was hoping someone could explain this error to me if possible, also any advice would be greatly appreciated! Thanks!!

Member Avatar
Member Avatar
+0 forum 5

So the program I'm writing should count how many of each individual vowel is in the program and then print that. I'm basically stuck with while and conditional statements. I think my if statement is where I've gone wrong. I'm not sure how to have it read the letter properly and the program didn't compile and I'm not sure why. Please help! Thank you. //Project 4.12 by Vivin Viswanathan import java.util.Scanner; public class VV_PP412 { public static void main (String[]args) { int cons = 0; int a,e,i,o,u = 0; int count = 0; String sent; Scanner scan = new Scanner …

Member Avatar
Member Avatar
+0 forum 3

I was wondering, is it possible to do something like the following? The given code obviously doesn't work. [CODE] l = 5 (l == 5)*(k = 7) #Returns error message.[/CODE] The reason is, I'd rather avoid doing something like the following for the project I'm currently working on. [CODE] if stmt1 == True or stmt2 == True: if stmt1 == True: k = 7 if k == 7: # Evaluate suite else: # Evaluate different suite [/CODE]

Member Avatar
Member Avatar
+0 forum 4

need help here's code I'm almost finish I'm trying to find out how can i search down to the student who is taking at least two database classes here's the code [code] drop table student; create table student (student_id varchar(10) primary key not null, student_name varchar(10), major varchar(20), gpa decimal(10,1)); insert into student values('12345', 'Bob', 'computer science', '4.0'); insert into student values('23456', 'Tim', 'art', '3.0'); insert into student values('54321', 'Rob', 'biology', '3.5'); insert into student values('98765', 'Sue', 'history', '2.5'); insert into student values('87654', 'Cindy', 'chemistry', '3.1'); insert into student values('11111', 'Kenny', 'computer science', '3.2'); insert into student values('22222', 'Renee', 'mathematics', …

Member Avatar
Member Avatar
+0 forum 3

I have this code, it's basically a program which I wrote, a 'Guess my number' game. The only problem is that I did something, and now I can't choose from my options anything else, that the first option. I put all my conditions in the while True loops, and now it won't let me choose anything else, just the first thing from the while. The same thing goes for the end of one level, meaning at the question "Redo", even thou I put the No answer it won't break, it will still get the first instruction to run, meaning the …

Member Avatar
Member Avatar
+0 forum 1

I have a php/mysql/html table of results The query is [CODE]$result = mysql_query(' Select var1, sum(var2) round(Avg(var3),0) round(Min(Price),2), round(Max(Price),2), round(Avg(Price),2) as AvgPrice, Country, From table Where country = "Australia" Group By var1 having var3 > 5 Order By var3 DESC') or die("SELECT Error: ".mysql_error()); $num_rows = mysql_num_rows($result); print "<table width=800 border=1>\n"; echo "<tr> <th>Var1</th> <th>Sum(Var2)</th> <th>Avg Var4</th> <th>£ Min</th> <th>£ Max</th> <th>£ Average</th> <th>Country</th> </tr>"; while ($get_info = mysql_fetch_row($result)){ print "<tr>\n"; foreach ($get_info as $field) print "\t<td><font face=arial size=2/>$field</font></td>\n"; print "</tr>\n"; } print "</table>\n"; [/CODE] What I want to do is to highlight a cell where an individual result is …

Member Avatar
Member Avatar
+0 forum 1

This question is a bit academic now as my contract at this place is coming rapidly to a close. But for future reference, I'd be very interested in the answer. We're talking about .Net 2.0 and Visual Studio 2005. Don't limit your responses to this platform though; I'm interested in best practice rather than hacky work-arounds for an elderly platform. The company where I've been working runs different DEV, SIT, UAT and PROD databases. They have connection strings for all four databases in their app.config file, but only one is uncommented at any given time. To do a SIT build, …

Member Avatar
Member Avatar
+0 forum 3

I'm writing an application for processing scientific data. The data is displayed in a jTable. I'm done with the data processing itself, now I want to do some conditional formatting to make interpretation easier for the end user. [LIST=1] [*]The last column of the table contains a threshold value, and if the data in a particular cell is below the threshold at the end of the row the fond needs to be changed to a different color. [*]On top of that, if a value is below zero the background color of that cell needs to be changed. This rule applies …

Member Avatar
Member Avatar
+0 forum 17

Hi, I'm developing a web app, but I think that maybe I'm not doing it the right way. See, for each page I take the GET variables from url, for instance: [url]www.webapp.com/?mode=register[/url] That way, the index gets the variable and displays the right page, in this case, the registration page. But I do it this way: [CODE] <?php include "page/header.php"; if($_GET['mode']==='register'){ //code for registration //this next file contains the HTML for the registration page. include "mod/register.php"; }elseif($_GET['mode']==='login'){ //code for login include "mod/login.php"; }else{ include "mod/404.php"; } ?> include "page/footer.php"; [/CODE] Is that a good way of handling different pages from …

Member Avatar
Member Avatar
+0 forum 4

Can you help me with the following Mysql question? I get a table, say, three variables: ID, Date and Value, for example, ID Date Value 1 2001 2 2 2005 3 3 1986 7 4 1985 1 How can I add a variable, sum, to each line, with the condition that sum=sum the value of all the records that are early than the record’s date For the same sample on the top, I want the result turns out to be: ID Date Value Sum 1 2001 2 8 2 2005 3 10 3 1986 7 1 4 1985 1 0 …

Member Avatar
Member Avatar
+0 forum 4

Hello, I have a query, that I am trying to have a conditional statement for a variable that I will pass into the query. If I use one of the conditions it works, but if I try both I can't get it to work. I would appreciate any help. Thanks, Aaron [CODE]if (!empty($zipcode)){ $query_string = "sorted_zipmhaYY.ZIPCODE='".$zipcode."'"; } if (!empty($MHA)){ $query_string = "mhanamesYY.MHA='".$MHA."'"; } if($searching == "yes"){ $query = "SELECT bahwYY.$rank, sorted_zipmhaYY.ZIPCODE, mhanamesYY.MHA,bahwYY.Dependents, bahwYY.YEAR_MHA FROM bahwYY LEFT JOIN sorted_zipmhaYY ON sorted_zipmhaYY.MHA=bahwYY.MHA INNER JOIN mhanamesYY ON mhanamesYY.MHA=sorted_zipmhaYY.MHA WHERE ". $query_string ." AND bahwYY.YEAR_MHA='$year' ORDER BY sorted_zipmhaYY.zipcode ASC";[/CODE]

Member Avatar
Member Avatar
+0 forum 1

The End.