1,257 Posted Topics
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: [CODE]<?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>"; } ?> [/CODE] ![]() | |
Re: I hope this query will work [CODE]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)[/CODE] | |
Re: 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 [CODE]select product_code,product_name,item_code, max(date) last_date from tablename group by product_code,product_name,item_code [/CODE] | |
Re: 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 [url]http://stackoverflow.com/questions/108403/solutions-for-insert-or-update-on-sql-server[/url] | |
![]() | |
Re: before value remove that extra comma after report_period_end_month | |
Re: 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 [CODE] var number = Math.round((Math.random() * 9) )+ … | |
Re: what do u mean by "hasnt been selected" | |
Re: 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 … | |
| |
Re: you must access webiste with computer name or ip, if u want to run in another pc [url]http://computerName:3965/Survey/SurveyPreview/105[/url] [url]http://computerIpAddress:3965/Survey/SurveyPreview/105[/url] 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 … | |
Re: I assume that you have only one form on page, so to solve your problem, change all [CODE]document.forms.useraction.action[/CODE] to [CODE]document.useraction.action[/CODE] | |
Re: You try this code in separate page, then try to do in ur logic. [CODE]<?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 … | |
Re: [CODE]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' )[/CODE] I think between will work proper only for number … | |
Re: [CODE]fputs($fp, "{$_POST['Fullname']},{$_POST['Jobtitle']}, {$_POST['email']} ,{$_POST['file']} ,\n");[/CODE] Use braces {} to encapsulate variables in string | |
Re: I have replied your previous thread, you may check it whether it is helping u or not. [url]http://www.daniweb.com/web-development/databases/ms-sql/threads/389707/1684223#post1684223[/url] | |
Re: 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 | |
Re: how u form the list of 5000 items, is it somewhere stored in same database. or you do it in your front end. | |
Re: you must call session_start() in all pages, in the beginning of your code. | |
Re: [CODE]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 [/CODE] | |
Re: 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 } [CODE] <?php require("Wordnik.php"); $api_key = "/*MY API KEY WAS HERE IT WAS REMOVED TO SAFEGUARD … | |
Re: 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. | |
Re: I think loading all records in client is not good way of doing it when number of records are more then in tens. So ajax-jquery combination is best way you can learn jquery/ajax at [url]http://phpacademy.org/videos/index.php?all[/url] | |
Re: You can use session variable or HTML HIDDEN ELEMENT | |
Re: Two ways to do this, as fields value is fluctuating, 1) One is keep level field in usermaster table and whenever score is updated, update level column in usermaster, using insert/update/delete database trigger. 2) another way is, do not create level field in any table rather, create one view say … | |
Re: I think this could help you. [CODE]$row_rs_propdetails['add_date']=strtotime($row_rs_propdetails['add_date']);//this will convert mysql text date to php date object echo date('Y-m-d',$row_rs_propdetails['add_date'] );//now show date object in required format[/CODE] | |
Re: whatever is the database, selection of primary keys and foreign keys play important role in database design. | |
Re: I think you must use mysql function last_insert_id() when u insert data in tblscvdata like [CODE] query1="insert into `tblEventAlert` ( `eventAlertID` , `enterpriseID` , `associateID` ..) values(null,'1','2')"; mysql_query(query1); query2="insert into `tblscvdata` ( `scvDataID` , `header` , `deviceType` ..) values(last_insert_id(),'hdr','det')"; mysql_query(query2); [/CODE] | |
Re: [CODE]if (trim($link_one)!="") $db->query( "INSERT INTO " . PREFIX . "_post_links (matchid, link) VALUES('{$row}', '{$link_one}')" ); if (trim($link_two)!="") $db->query( "INSERT INTO " . PREFIX . "_post_links (matchid, link) VALUES('{$row}', '{$link_two}')" ); if (trim($link_three)!="") $db->query( "INSERT INTO " . PREFIX . "_post_links (matchid, link) VALUES('{$row}', '{$link_three}')" ); if (trim($link_four)!="") $db->query( "INSERT INTO … | |
Re: Its good that you are sharing useful stuffs for newbies, but you can post such things as "code snippets" rather then to regular posts. | |
Re: if you want to delete things, on path_id from the related table, so best thing is [COLOR="Green"]create foreign keys in all related table with cascade delete option[/COLOR] | |
Re: change your columns names accordingly [CODE]select customer, sum(case when month(datecolname) in (1,2,3) then quantity else 0 end) jan_mar sum(case when month(datecolname) in (4,5,6) then quantity else 0 end) apr_jun, sum(case when month(datecolname) in (7,8,9) then quantity else 0 end) jul_sep, sum(case when month(datecolname) in (10,11,12) then quantity else 0 end) … | |
Re: following code is fine [CODE]header('Location: http://www.example.com/'); //redirects user exit;[/CODE] you can ask your server administrator HOW TO SET DNS property. They might help you to map ip<->domain. | |
Re: [CODE]<html> <script language="javascript"> function validate(dt1,dt2) { var jdt1=Date.parse('20 Aug 2000 '+dt1); var jdt2=Date.parse('20 Aug 2000 '+dt2); alert(jdt1); if(jdt1==NaN) { alert('invalid start time'); return false; } if(jdt2==NaN) { alert('invalid end time'); return false; } if (jdt1>jdt2) { alert('start is greater'); } else { alert('start is less equal'); } } </script> <body> … | |
Re: I think problem is in the page which is calling this page and not on this page. Check the spelling of your form elements in previous form. | |
Re: [CODE]select date_format(datecolname, '%d-%m-%Y') as formated_date from tablename[/CODE] | |
Re: in new page you can use php variable in javascript following way [CODE]<?php . . . $query = mysql_query(" INSERT INTO reservation VALUES('','$fname','$email','$pnum','$numofperson','$numofroom','$roomtype','$cur_date','$time2','$date_value','$stay','pending','$tot2','$tot2','0') "); . . . ?> <html> <script lang='javascript' > function myfunction() { var firstnm="<?php echo $fname;?>"; alert(firstnm); } </script>[/CODE] | |
Re: hidded field are used to for additional information , that user may not need to enter or sometime it is used to store some parameters passed by previous page, that will be used along with other input elements in the processing page. | |
Re: you can create two separate pages for say 1) current 2) archive the difference is only in query for current [CODE]select * from tablename where deadline>current_date()[/CODE] for archive [CODE]select * from tablename where deadline<=current_date()[/CODE] | |
Re: [CODE] SELECT b.CODE, b.NAME,a.BUYER, AVG(a.TOTAL) AS total FROM SMF a WHERE a.PERIOD1 > DATEADD(YEAR, -10, GETDATE()) group by b.CODE, b.NAME,a.BUYER having AVG(a.TOTAL)>100000 inner join ACCODE b on b.CODE = a.BUYER[/CODE] | |
Re: [CODE]$confirmation = ($result)? "Data telah terhapus.":"Gagal menghapus data.";[/CODE] You are setting confirmation in if condition so it is giving warning when you tried to used unintialise variable. so before your if statement you write [CODE]$confirmation="";[/CODE] | |
Re: php is case sensitive language so use all capital letters for SESSION [CODE]if ($_SESSION['LoggedIn'] !=null)[/CODE] | |
Re: [CODE]SELECT * FROM `tablename` WHERE date_add( current_date(), INTERVAL -1 MONTH ) < date_colname[/CODE] ![]() | |
Re: [CODE]$list=implode(",",$q); $query=" SELECT * FROM table WHERE ID in ($list)";[/CODE] | |
Re: Php is server side lanaguage so it will always shows date time of server where the script is installed. You date time zone depends on UTC setting on your webserver. If you use javascript date, it will show date time of the local computer where your page is opened. |
The End.