1,257 Posted Topics

Member Avatar for pawan768

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 …

Member Avatar for adam_k
0
149
Member Avatar for mayreeh

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.

Member Avatar for mayreeh
0
72
Member Avatar for riya_developer

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 …

Member Avatar for urtrivedi
0
244
Member Avatar for swilliamrobert

[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]

Member Avatar for diafol
0
187
Member Avatar for ssreevidya.m

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]

Member Avatar for red_ruewei
0
5K
Member Avatar for aneeka

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]

Member Avatar for BitBlt
0
121
Member Avatar for jetlife76
Member Avatar for pro_learner
Member Avatar for violette

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]

Member Avatar for violette
0
165
Member Avatar for Nuzhser
Member Avatar for violette
Member Avatar for WaltP
0
598
Member Avatar for schoolboy2010

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) )+ …

Member Avatar for schoolboy2010
0
223
Member Avatar for narekm
Member Avatar for ssreevidya.m

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 …

Member Avatar for urtrivedi
0
208
Member Avatar for gourav1

This has got nice video tutorial for basic things phpacademy.org

Member Avatar for Stefano Mtangoo
0
117
Member Avatar for riya_developer

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 …

Member Avatar for urtrivedi
0
99
Member Avatar for Coyx

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]

Member Avatar for Coyx
0
488
Member Avatar for dd2308

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 …

Member Avatar for Troy III
0
297
Member Avatar for violette

[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 …

Member Avatar for violette
0
187
Member Avatar for jocky c

[CODE]fputs($fp, "{$_POST['Fullname']},{$_POST['Jobtitle']}, {$_POST['email']} ,{$_POST['file']} ,\n");[/CODE] Use braces {} to encapsulate variables in string

Member Avatar for jocky c
0
165
Member Avatar for ssreevidya.m

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]

Member Avatar for urtrivedi
0
123
Member Avatar for gotboots

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

Member Avatar for urtrivedi
0
173
Member Avatar for Tank50

how u form the list of 5000 items, is it somewhere stored in same database. or you do it in your front end.

Member Avatar for Prateek nandan
0
511
Member Avatar for madz015
Member Avatar for madz015
0
7K
Member Avatar for ashishsax

[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]

Member Avatar for ashishsax
0
307
Member Avatar for tusharbhatia

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 …

Member Avatar for tusharbhatia
0
265
Member Avatar for aecha

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.

Member Avatar for rpv_sen
0
2K
Member Avatar for vitaquous

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]

Member Avatar for vitaquous
0
236
Member Avatar for wolfgangcs
Member Avatar for Agentsmith

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 …

Member Avatar for smantscheff
0
210
Member Avatar for ebanbury

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]

Member Avatar for mschroeder
0
217
Member Avatar for LRNPHP

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

Member Avatar for LRNPHP
0
173
Member Avatar for newbie14

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]

Member Avatar for urtrivedi
0
143
Member Avatar for reco21

[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 …

Member Avatar for reco21
0
150
Member Avatar for steventaal

Its good that you are sharing useful stuffs for newbies, but you can post such things as "code snippets" rather then to regular posts.

Member Avatar for urtrivedi
0
114
Member Avatar for TheSassyDragon

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]

Member Avatar for urtrivedi
0
123
Member Avatar for Dumb Fish

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) …

Member Avatar for Netcode
0
147
Member Avatar for nikki05

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.

Member Avatar for suley04
0
543
Member Avatar for karthik_ppts

[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> …

Member Avatar for karthik_ppts
0
218
Member Avatar for davy_yg

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.

Member Avatar for urtrivedi
0
93
Member Avatar for khushhappy

[CODE]select date_format(datecolname, '%d-%m-%Y') as formated_date from tablename[/CODE]

Member Avatar for urtrivedi
0
86
Member Avatar for gerbz

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]

Member Avatar for gerbz
0
231
Member Avatar for musicmancanora4

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.

Member Avatar for urtrivedi
0
131
Member Avatar for khushhappy

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]

Member Avatar for khushhappy
0
109
Member Avatar for Dumb Fish

[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]

Member Avatar for urtrivedi
0
108
Member Avatar for davy_yg

[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]

Member Avatar for cwarn23
0
100
Member Avatar for davy_yg

php is case sensitive language so use all capital letters for SESSION [CODE]if ($_SESSION['LoggedIn'] !=null)[/CODE]

Member Avatar for ko ko
0
256
Member Avatar for bala2111

[CODE]SELECT * FROM `tablename` WHERE date_add( current_date(), INTERVAL -1 MONTH ) < date_colname[/CODE]

Member Avatar for diafol
0
3K
Member Avatar for Buppy
Member Avatar for urtrivedi
0
287
Member Avatar for deraad

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.

Member Avatar for deraad
0
93

The End.