Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
int nb_line=((Integer)globalMap.get("tMysqlInput_1_NB_LINE"));
if(nb_line>0){
globalMap.put("hasRows",true);
}else{
globalMap.put("hasRows",true);
}
Another quick thing carrying on from the above.
Ive been trying to get it to insert a row when the IF statements returns false and update the row when it returns true. I imagine I will need MySQL row somewhere along the line but have had no luck as of yet.
Any response would be much appreciated.
Thanks in advance
$sql = " select * from departments where country_id = 'UK'";
$result = mysql_query($sql);
$num_rows = mysql_num_rows($result);
if ($num_rows == 1)
{
$row = mysql_fetch_array($result);
$id = $row;
$sql = "update departments set dept_name = 'xxx', dept_type = 'xxx' where dept_id = '$id'";
mysql_query($sql);
}
else
{
$sql = "insert into departments (dept_name, dept_type, deptfloor) values ($deptname, $depttype, $deptfloor)";
mysql_query($sql);
}
if(!String.valueOf(input_row.count).equals("1"))
{
globalMap.put("query", "SELECT * FROM table where country = "+input_row.country+""); // input_row.country is the hard coded value from the query
globalMap.put("TF", "false");
}
else if(String.valueOf(input_row.count).equals("1"))
{
globalMap.put("query", "SELECT * FROM table where country = "+input_row.country+""); // input_row.country is the hard coded value from the query
globalMap.put("TF", "true");
}