urtrivedi 276 Nearly a Posting Virtuoso

1) remove space between <? PHP, it should read <?PHP
2) add semicolon to line number 17 in above code in the end

urtrivedi 276 Nearly a Posting Virtuoso

can you upload your excel file, and do specify what you want to achieve.

urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

better if you keep condition in your stored procedure and not in your front end

'@category as varchar(50),
Session("Category") = DDLBuildingType.Text
'----------------------------------------
Dim parameterCategory As SqlParameter = New SqlParameter("@category", SqlDbType.VarChar, 50)
parameterCategory.Value = Session("category")
myCommand.SelectCommand.Parameters.Add(parameterCategory)
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go

ALTER PROCEDURE [dbo].[Search_Realestate] 
(
	
	@RegID as varchar(50),
	@category as varchar(50)
) 

as

if @cateogry='All' 
begin
	select 
	headline as headline,
	subNumber as subNumber,
	streetNumber as streetNumber,
	street as street,
	suburb as suburb,
	'$' + price as price,
	bedrooms as bedrooms,
	bathrooms as bathrooms,
	garages as garages,
	description as description,
	image1 as URL1, 
	category as category,
	
	Ref_No as RefNo,
	Rowguid
	from Realestate
	Where @RegID = 'Admin' 
end
else
begin

	select 
	headline as headline,
	subNumber as subNumber,
	streetNumber as streetNumber,
	street as street,
	suburb as suburb,
	'$' + price as price,
	bedrooms as bedrooms,
	bathrooms as bathrooms,
	garages as garages,
	description as description,
	image1 as URL1, 
	category as category,
	
	Ref_No as RefNo,
	Rowguid
	from Realestate
	Where @RegID = 'Admin' and category = @category

end
urtrivedi 276 Nearly a Posting Virtuoso

After completing the operation
you can set format by following code. So just set your format for the range

Range("C1").Select
Selection.NumberFormat = "dd/mm/yyyy hh:mm:ss" 'Date as10/06/2005
Selection.NumberFormat = "dd/mm/yyyy hh:mm" No seconds displayed
Selection.NumberFormat = "dd-mmm-yyyy hh:mm:ss" 'Date as 10-Jun-2005
Range("D1").Select
Selection.NumberFormat = "@" 'Text
urtrivedi 276 Nearly a Posting Virtuoso

md5 is function you can use one way only, you can not find the password by any reverse kind of function.

better you regenerate new password in case user forget password.

urtrivedi 276 Nearly a Posting Virtuoso

You must add one more column password_last_date, when u insert record, add timestamp to that field.

Now when you check login, compare current datetime and datetime in that password_last_date field to check whether it is expired or not.

urtrivedi 276 Nearly a Posting Virtuoso

this design looks good,
but i will suggest you one thing

add one more column in orderline (orderid, it is referred from order table)
remove orderlineid from order table

urtrivedi 276 Nearly a Posting Virtuoso

You seems to be confused or your you have not explained your case exactly.
So what is relation between account and client, that will decide how to use accountid and clientid in other tables

Do you have many client for one account?
or do you have one client may be linked with many accounts?
or one account for one client?

urtrivedi 276 Nearly a Posting Virtuoso

you need to create after insert trigger on employee table, in which you should write update statement for department table

update department set no_of_employees =no_of _employees+1 where dept_id=new.dept_id

then you create delete trigger
update department set no_of_employees =no_of _employees-1 where dept_id=old.dept_id

then you create update trigger
update department set no_of_employees =no_of _employees+1 where dept_id=new.dept_id
update department set no_of_employees =no_of _employees-1 where dept_id=old.dept_id


http://dev.mysql.com/doc/refman/5.0/en/triggers.html

urtrivedi 276 Nearly a Posting Virtuoso

Here is sample json example, I hope you get something from it.

<html>
<body>
<h2>Create Object from JSON String</h3>
<p>
First Name: <span id="fname"></span><br /> 
Last Name: <span id="lname"></span><br /> 
</p> 
<script type="text/javascript">
var txt = '{"employees":[' +
'{"firstName":"John","lastName":"Doe" },' +
'{"firstName":"Anna","lastName":"adSmith" },' +
'{"firstName":"Peter","lastName":"Jones" }]}';

obj = JSON.parse(txt);

document.getElementById("fname").innerHTML=obj.employees[1].firstName 
document.getElementById("lname").innerHTML=obj.employees[1].lastName 
</script>
</body>
</html>
urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso
<?php
$string="--_BeginData_
payeeId=xxxx
channelId=ECEP
billAccountNo=exb111109-315262
billReferenceNo=TOPUP20111109200257
amount=42
paymentRefNo=61417686
transactionDate=20111109
transactionTime=194843
userFullName=KHOR JO FENG
status=S
--_EndData_";


$data=split("\n", $string);
echo "<pre>";
print_r($data);
echo "</pre>";

for ($i=1;$i<=10;$i++)
{
	$rec=split("=", $data[$i]);	
	echo $rec[1]."<br>";
}


?>
urtrivedi 276 Nearly a Posting Virtuoso

username is root

urtrivedi 276 Nearly a Posting Virtuoso

I assume 2 thing that
1) product code is not entered more than once for same date
2) date column is not having time portion

select product_code,product_name,item_code, max(date) last_date  from tablename group by product_code,product_name,item_code
urtrivedi 276 Nearly a Posting Virtuoso

post whatever work u have done so far

urtrivedi 276 Nearly a Posting Virtuoso

For sheet to work, I think you must have loop in lopp

for 1 to n worksheet
while cell empty
end while
end for


and for duplicate checking ur codes may hang due to deadlock, you can follow the link given here
http://stackoverflow.com/questions/108403/solutions-for-insert-or-update-on-sql-server

urtrivedi 276 Nearly a Posting Virtuoso

One query is not related to another query unless you execute both together in (one combined query).

You must have some flag in table to track the changes, buy using this flag u can filter your result.

urtrivedi 276 Nearly a Posting Virtuoso

what do u mean by "hasnt been selected"

urtrivedi 276 Nearly a Posting Virtuoso

If you have any text box on the form then
add following line before execution

txt1.text=sqlStr

 conn.Execute sqlStr

Then copy that query run it in sql analyzer and also post that generated query here also


Your code must look like following
NOTICE RED BOLD UNDERLINE, I HAVE REMOVED 2 COMMAS AND REPLACED BY CLOSING PARANTHESIS )

sqlStr = "INSERT INTO company_financial "
sqlStr = sqlStr & "(year_id, period_id, stock_code, receivable, revenue, total_liabilities, shareholders_equity, total_liabilities_to_shareholders_equity, current_liabilities, total_current_assets, net_attributable, inventories, fixed_assets, operating_cost, net_cash_operation, price_close, pe, eps, pe_relative_sector, altman_z_score, paid_up_capital, net_profit_or_loss, dec_stock, dec_debtors, inc_creditors, net_investments, cash_and_equivalents, retained_profit_or_loss, ebit, mkt_cap, sales_to_assets, rota, roe, debt_to_equity, average_shares, total_assets, shares_outstanding, report_period_end_month ) "
sqlStr = sqlStr & " VALUES "
sqlStr = sqlStr & " ('" & yearIdCom & " ', " & periodIdCom & ", " & stockCodeCom & ",'" & tradeReceivable & "', '" & revenueCom & "','" & TotLiability & "', '" & shareholderEqyCom & "', '" & totLiabToSE & "', '" & curLiability & "', '" & currentAss & "', '" & netAttributableCom & "','" & inventory & "', '" & fixedAsset & "', '" & operatingExpenses & "', '" & operatingCashFlow & "', '" & ClosingPrice & "', '" & priceEarningRatio & "','" & earningPerShare & "','" & peRatio & "','" & altmanZ & "','" & paidUpCapital & "','" & netPOL & "','" & incStock & "'," & netInvest & "'," & netInvest & "'," & netInvest & "','" & cashNeqvalent & …

urtrivedi 276 Nearly a Posting Virtuoso

check whether following query works for you or not

select Transport_Details.User_Id, Route_Fee.Fee 
from Transport_Details  join  Route_Fee 
on Transport_Details.bus_route_Fare_Stage_Id=Route_Fee.bus_route_Fare_Stage_Id 

where 

(   ( year(startDate)*100+month 
               between 
               year(startDate)*100 + month(startdate) and year(enddate)*100 + month(enddate)
   )
or  (year(endDate)*100+month 
               between 
               year(startDate)*100 + month(startdate) and year(enddate)*100 + month(enddate)
  )
)
and Route_Fee.Month=4
urtrivedi 276 Nearly a Posting Virtuoso

Post following 3 things here
1) sample data (you have posted 30-feb-2012 date above, roni is not in your sample data, how u expect roni)
2) sample data of Route_Fee table also is needed (at least give data of fs1, fs2 and fs4)
3) paramter u want to pass (say monthid=5 or u want to pass from date to date range)
4) sample result you want from 1 and 3 above

urtrivedi 276 Nearly a Posting Virtuoso

before value remove that extra comma after report_period_end_month

urtrivedi 276 Nearly a Posting Virtuoso

1) Modify your script as given below. You can not generate number all time user press button. Instead you must generate number only once, outside the function.

2) Also random number generated is float, so you must round it to match properly

var number = Math.round((Math.random() * 9) )+ 1;

function guessed() 
{
	
	var guessField = document.getElementById('guess');
	var choice = guessField.value;
	
	var win = 0;
	
	while (win == 0)
	{
		if (choice > number)
		{
			var output = document.getElementById('output');
			output.value = 'Guess lower';
			win = 0;
		}
		else if (choice < number)
		{
			var output = document.getElementById('output');
			output.value = 'Guess higher';
			win = 0;
		}
		else
		{
			var output = document.getElementById('output');
			output.value = 'Correct, you win!';
			win = 1;
		}
		
		return false;
	}
}
urtrivedi 276 Nearly a Posting Virtuoso

There are so many issues involved in it. its not straigh forward
You can not use that way u are expecting
1) you need to register a domain name
2) you need to have real ip for your computer (permannent)
3) you need to map domain ip throught dns server
4) you have to setup firewall in your computer


One best way I can suggest is You find free domains available like

http://www.aspspider.com/

, then you can host your site there.
making your computer accessible to world is not easy and safe

urtrivedi 276 Nearly a Posting Virtuoso

Post following 3 things here
1) sample data
2) paramter u want to pass (say monthid=5 or u want to pass from date to date range)
3) sample result you want from 1 and 2 above

urtrivedi 276 Nearly a Posting Virtuoso

you must access webiste with computer name or ip, if u want to run in another pc

http://computerName:3965/Survey/SurveyPreview/105

http://computerIpAddress:3965/Survey/SurveyPreview/105

Also in your computer where website is installed, you must allow port 3965 in firewall (settings depends on the operating system used)

Now your site must work on any pc in your local area network.

urtrivedi 276 Nearly a Posting Virtuoso

There could be so many books

I used following book of wrox publications
Beginning PHP5, Apache, MySQL WebDevelopment -- 2007 Naramore, Elizabeth

urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

This has got nice video tutorial for basic things

phpacademy.org

urtrivedi 276 Nearly a Posting Virtuoso

I think this must work

SELECT ma5.alert_value,period_id,year_id
FROM company_alert ma5
LEFT JOIN qiddb.company_info mb5 ON (mb5.stock_code=ma5.stock_code)
LEFT JOIN ref_sector mc5 ON (mc5.sector_code=mb5.sector_code)
WHERE ma5.alert_id='DSO' AND mc5.sector_code='s06' 
AND (

ma5.year_id*10+ma5.period_id between 2009*10+3 and 2010*10+1 

)


GROUP BY year_id,period_id

2009*10+3 and 2010*10+1 you just change parameter of year period through ur front end

urtrivedi 276 Nearly a Posting Virtuoso

it your choice when u call, I have just shown demo. U run it separately and check it works or no

urtrivedi 276 Nearly a Posting Virtuoso

You try this code in separate page, then try to do in ur logic.

<?php 
//find out how many check box u have from database,
 $noofcheckboxes =5 ;

?>

<script lang='javascript'>
	//on page load we assume that 0 boxes checked
	var checkedcount=0;
	
	//this fuction is called when any box is checked or unchecked, it wil update checkedcount variable
	function checkinfo(chkbox)
	{
			
			if(chkbox.checked==true)
				checkedcount++;
			else
				checkedcount--;
	
	}
	     
	//this fucntion is called when form is submitted
	function checkdata()
	{
		
		if(checkedcount==0)
		{	
			alert("Please select At least Customer ");//At least one record must be checked for delete
			return false;
		}
		alert("ok");//
	}
</script>

<body >
<form>

<input type=checkbox id=cust_id[0]   name=cust_id[0] value=c1 onclick='javascript:checkinfo(this);' > cust 1<br>
<input type=checkbox id=cust_id[1]   name=cust_id[1] value=c2 onclick='javascript:checkinfo(this);' > cust 2<br>
<input type=checkbox id=cust_id[2]   name=cust_id[2] value=c3 onclick='javascript:checkinfo(this);' > cust 3<br>
<input type=checkbox id=cust_id[3]   name=cust_id[3] value=c4 onclick='javascript:checkinfo(this);' > cust 4<br>
<input type=checkbox id=cust_id[4]   name=cust_id[4] value=c5 onclick='javascript:checkinfo(this);' > cust 5<br>

<br>
<input type=button onclick='checkdata()' value=check >
<br>

</form>
</body>
urtrivedi 276 Nearly a Posting Virtuoso

I assume that you have only one form on page,
so to solve your problem, change all

document.forms.useraction.action

to

document.useraction.action
urtrivedi 276 Nearly a Posting Virtuoso
fputs($fp, "{$_POST['Fullname']},{$_POST['Jobtitle']}, {$_POST['email']} ,{$_POST['file']} ,\n");

Use braces {} to encapsulate variables in string

urtrivedi 276 Nearly a Posting Virtuoso
SELECT SUM(ma5.alert_value) 
FROM company_alert ma5 
LEFT JOIN qiddb.company_info mb5 ON (mb5.stock_code=ma5.stock_code) 
LEFT JOIN ref_sector mc5 ON (mc5.sector_code=mb5.sector_code)
WHERE ma5.alert_id='VPAEH' AND mc5.sector_code=ref.sector_code AND 
ma5.year_id BETWEEN '2009' AND '2010' 
AND (
ma5.period_id BETWEEN 'q3' AND 'q1' 
   or 
ma5.period_id BETWEEN 'q1' AND 'q3' 
)

I think between will work proper only for number not string like q1 q3, you must compare like 1, 3 etc

any way I have added or condition for ur period, Parenthesis are very important

urtrivedi 276 Nearly a Posting Virtuoso

I have replied your previous thread, you may check it whether it is helping u or not.

http://www.daniweb.com/web-development/databases/ms-sql/threads/389707/1684223#post1684223

urtrivedi 276 Nearly a Posting Virtuoso

I hope this query will work

select * from Student_transport_Details 
where month(StartDate) = @monthid 
or month(endDate) =@monthid
or ( convert(datetime, '01-'+cast(@monthid as varchar)+'-'+year(startdate), 105) between StartDate and enddate)
or ( convert(datetime, '01-'+cast(@monthid as varchar)+'-'+year(enddate), 105) between StartDate and enddate)
urtrivedi 276 Nearly a Posting Virtuoso

that means you have not stored your date using "date" datatype, you might be using varchar datatype.

So in short change datatype to "date" of that column

urtrivedi 276 Nearly a Posting Virtuoso

the solution i have provide is not execedding 250 characters. if you want to calculate, you have to do in select part

urtrivedi 276 Nearly a Posting Virtuoso
select sum(case when co1='conditin1' then 1 else null end)/sum(case when co2='conditin2' then 1 else null end) as ratio from TableA
urtrivedi 276 Nearly a Posting Virtuoso

1) You are using : after if that is not valid
2) you must embed html in {} if it is conditional
3) endif is no php keywork rather you must use closing brace }

<?php 
  require("Wordnik.php"); 
  $api_key = "/*MY API KEY WAS HERE IT WAS REMOVED TO SAFEGUARD */";
  // create an instance of the Wordnik class, to make api calls
  $wordnik = Wordnik::instance($api_key);
  // get the Word of the Day
  $wotd = $wordnik->getWordOfTheDay();
  $wotd = $wotd->wordstring;
  // if the user pressed the "I'm Feeling Wordie" button, fetch a random word and set it to $wordstring
  if (isset($_GET['commit']) && ($_GET['commit']=="I\'m Feeling Wordie")) {
    $word = $wordnik->getRandomWord();
    $wordstring = $word->wordstring;
  } else if (isset($_GET['word'])) { // the user is searching for a specific word, either via the form or a link
    $wordstring = $_GET['word'];
  }
?>
<html>
  <head>
    <title>Hello, Dictionary!</title>
  </head>
  <body>
    <div>
      <h1>Hello, Dictionary!</h3>
      <h3>The Wordnik Word of the Day for <?php echo(date("l F j, Y")) ?> is... <strong><a href="/hello_dictionary.php?word=<?php echo(urlencode($wotd)) ?>"><?php echo($wotd) ?></a></strong>!
      </h3>
      <p>
        <form method='get' action='/hello_dictionary.php'>
          Look up a word: 
          <input type='text' name='word' />
          <input type='submit' name='commit' value='Search' />
          <input type='submit' name='commit' value="I'm Feeling Wordie" />
        </form>
      </p>
<?php if (isset($wordstring)){ ?>
  <hr />

  <!-- Definitions -->
  <div>
    <?php $definitions = $wordnik->getDefinitions($wordstring); ?>
    <h2>Definitions of <em><?php echo($wordstring) ?></em></h2>
    <?php if (empty($definitions)) { ?>
      <em>Sorry, we couldn't find any definitions!</em>
    <?php }else{ ?>
      <ul>
        <?php 
          foreach($definitions as $definition) {
            if (isset($definition->text)) {
              echo("<li>".$definition->text."</li>");
            }
          }
        ?>
      </ul>
      <a href="http://wordnik.com/words/<?php echo(urlencode($wordstring)) ?>">more definitions</a>
    <?php …
urtrivedi 276 Nearly a Posting Virtuoso

you must call session_start() in all pages, in the beginning of your code.

urtrivedi 276 Nearly a Posting Virtuoso

tcpdf libraries are something to ready made using which u can generate barcode reports.
If you still want to use your own logic, then specify teh exact problem, which part of code is failing in your case.

urtrivedi 276 Nearly a Posting Virtuoso

whatever is the database, selection of primary keys and foreign keys play important role in database design.

urtrivedi 276 Nearly a Posting Virtuoso

yes

urtrivedi 276 Nearly a Posting Virtuoso

you fetch last id in variable using sql query

"select last_insert_id()"
urtrivedi 276 Nearly a Posting Virtuoso

you must use html element array

<input type="text" class="edit bk" name="links[]"  id="links[]" style="width:350px">

Here is used [] IN NAMING html

now in php you will get array of links and u can use it as follows

$totaltextbox=count($_POST[links])
for ($i=0;$i<$totaltextbox;$i++)
{
  if(trim($_POST['links'][$i])=="")
       echo $_POST['links'][$i]."<br>"   ;
}
urtrivedi 276 Nearly a Posting Virtuoso
if(criteria = ...)
{
insert into tblGeoFenceAlert
Insert into tblScvData();//insert last_insert_id with appropirate column
}
if(criteria = ...)
{
insert into tblEventAlert
Insert into tblScvData();//insert last_insert_id with appropirate column
}
urtrivedi 276 Nearly a Posting Virtuoso

last_insert_id function of mysql takes care of all concurrency problem. So instead of building your own logic in java code, its safe to use mysql function.