1,257 Posted Topics

Member Avatar for sugikrish

[code] <html> <script lang='javascript'> function onselectchange() { document.formname.textboxname.value = document.formname.selelistname.options[document.formname.selelistname.selectedIndex].text; } </script> <form name=formname> <input type=textbox name=textboxname id=textboxname > <select name=selelistname onchange='javascript:onselectchange();'> <option value='1'/>one <option value='2'/>two <option value='3'/>three </select> </form> </html> [/code]

Member Avatar for sugikrish
0
112
Member Avatar for GrahamLawton
Member Avatar for rukshilag
Member Avatar for Utter_iMADNESS

eval is used to execute dynamic statement. like eval("\$var=7;");. It is not a fuction so the way you are using it is not correct. if you want to use variable value as variable name then you may use $$$... sign. as shown below. [code] <?php $var1 = 'lol'; $var2 = …

Member Avatar for rajarajan2017
0
112
Member Avatar for nonshatter

[code] select sellerid, count(*) nooftimes from sales where buyerid='$buid' group by sellerid, buyerid order by sellerid,buyerid,nooftimes desc limit 0,1 [/code] $cnt[0] will return you sellerid $cnt[1] will return you nooftime

Member Avatar for nonshatter
0
96
Member Avatar for Szabi Zsoldos

check your functions in a separte file say test.php [code] <?php include "functions.php"; echo getsig('someuid')."<br>"; echo getprofile('someuid'); ?> [/code] see whether it is giving propers output or not.

Member Avatar for urtrivedi
0
84
Member Avatar for sugikrish

[code] <html> <script lang='javascript'> function gotolink(link) { window.location=link.value; } </script> <body> <form name='frm'> <select name=sel onchange='javascript:gotolink(this)'> <option value='http://www.yahoo.com' />yahoo <option value='http://www.timesofindia.com' />times of india </select> </form> </body> </html> [/code]

Member Avatar for sugikrish
0
79
Member Avatar for smoh

Best way is to save information linkwise and datewise linkname varchar(255) // trans_date date total integer when ever some link is opened insert/update above table. if date,link combination does not exist then insert it else update total=total+1 now for reporting periodwise is very easy say if you want monthwise [code] …

Member Avatar for urtrivedi
0
84
Member Avatar for ad1das

[code] select order,comment_no, note from orders a inner join (select order, max(comment_no) comment_no from orders GROUP BY order) b on order=b.order and a.comment_no=b.comment_no [/code]

Member Avatar for urtrivedi
0
97
Member Avatar for WaleedaaN

[code] <html> <script lang='javascript'> var total=0; function findtotal(flag,value1) { if (flag) total=total+parseInt(value1, 10); else total=total-parseInt(value1, 10); document.frm.total.value=total; } </script> <body> <form name=frm> Cars <input type=checkbox value=2000 onclick="javascript:findtotal(this.checked,this.value)"><br> Rendtv <input type=checkbox value=20 onclick="javascript:findtotal(this.checked,this.value)"><br> Blah<input type=checkbox value=2590 onclick="javascript:findtotal(this.checked,this.value)"><br> <input type=text readonly name=total id=total > </form> </body> </html> [/code]

Member Avatar for urtrivedi
0
98
Member Avatar for MDanz

[code] <?php $rows=5; print "<table border=0>"; for($i=0;$i<$rows;$i++) { print "<tr>"; for ($j=0;$j<=$i;$j++) { print "<td >".$i*$j."</td>" ; } print "<tr>"; } ?> [/code]

Member Avatar for rajarajan2017
0
68
Member Avatar for Usura

[code] <script lang='javascript'> function joinname() { document.frm.fullname.value= document.frm.fname.value+' ' +document.frm.lname.value; } </script> <form name=frm id=frm > <input type=text name=fname id=fname onblur='javascript:joinname()'> <input type=text name=lname id=lname onblur='javascript:joinname()'> <input type=text name=fullname id=fullname readonly > </form> [/code]

Member Avatar for Usura
0
141
Member Avatar for sinyi

use braces {} around php variables like shown below print "<option value=\"{$SourceID}\" {$selected}> {$ItemName} </option>";

Member Avatar for rajarajan2017
0
280
Member Avatar for sjeggels

[ C O D E ] WRITE YOUR CODE here [ / C O D E ] do not use space in [ c o d e ] as i have used

Member Avatar for rajarajan2017
0
232
Member Avatar for rukshilag
Member Avatar for godfather21

You can not submit multiple form at the same time. for that you need to use hidden elements. So before submitting form, you need to fill these hidden elements with required data from other forms.

Member Avatar for urtrivedi
0
139
Member Avatar for sugikrish

if you want more than one trailing or leading spaces then "&nbsp;" is the only way to do it.

Member Avatar for urtrivedi
0
78
Member Avatar for raju_boini525

you forget about the automatic things. YOu simply write script to check records where current date is greater than expiry date in user table. then for those records send mail to user and update their status from gold to bronze. AFter you complete this script tell your administrator or webmaster …

Member Avatar for SKANK!!!!!
0
120
Member Avatar for furqan219

You question is confusing. filtering the result and ordering the result is different thing. we use "where" clause to filter and "order by " clause to order. Your queries for ordering are as follows for ordering. ascending SELECT * FROM $tbl_name WHERE TO_DAYS( NOW( ) ) - TO_DAYS( `pDate` ) …

Member Avatar for SKANK!!!!!
0
165
Member Avatar for andydeans

when some ones login into your system. Determine the access level and store it in a session varaible. then whereever you are querying your database you may write follwoing code. [code] if($_SESSION['accesslvl']=1) //for example 1 is for admin $query="SELECT * FROM clients WHERE client_id = $client_id"; else //otherwise $query="SELECT * …

Member Avatar for SKANK!!!!!
0
87
Member Avatar for mrjoli021

after removing <? ?> tags then use htmlentities function to output html code on browser. echo htmlentities("your html string");

Member Avatar for SKANK!!!!!
0
211
Member Avatar for nonshatter

I have written changes in bold letters. You must add some expression against title column you cannot write title or description. change your query as following. $countofrecs = mysql_query("SELECT count(*) from tablename WHERE title [b] LIKE '%".$searchterm."%' [/b] OR description LIKE '%".$searchterm."%' OR catid = '$catid'");

Member Avatar for urtrivedi
0
61
Member Avatar for futhonguy

If you say that your result is not showing 3rd option, that is else part of your if condtion, then it means that your all rows in row_export is satisfying your following condition [b] if (trim($pib_bracket_num) !='' and trim($HW_design) !='' )[/b], so it is priting only option 1 and 2. …

Member Avatar for futhonguy
0
147
Member Avatar for psank
Member Avatar for brookstone

Following query will give you all records that are in A, whenever b.flag is 'Y' it will show 'Y' other wise it will show null. You may still apply where clause at the end of query to filter your records. [code] SELECT a.*, case when b.flag='Y' then b.FLAG ELSE NULL …

Member Avatar for kplcjl
0
137
Member Avatar for situ_info

[code] <?php //this is php $phpvar=5+10; ?> <html> <script lang='javascript'> //this is javascript javavar=<?php echo $phpvar;?> ; alert(javavar); </script> <body> this is html </body> </html> [/code]

Member Avatar for urtrivedi
0
44
Member Avatar for ismael ahm@d

why you are using sum_of_debit, sum_of_credit columns as it holds same value as debit and credit column. If you want to automatically insert balance, then post your insert query code. you need to modify your insert query for auto updation and without html values.

Member Avatar for ismael ahm@d
0
92
Member Avatar for EntangledDesi

you have typed > instead of ) at the end of line no 28 of your code, remove > and type ) document.write("<H4><FONT Color='firebrick'>"+introMsg+"</H4></FONT" [b])[/b]

Member Avatar for essential
0
181
Member Avatar for muralibobby2015

What ever you are asking may happen using switch..case statement without using break [code] switch ($variable) { case '1': print "hello"; //break; case '2': print "world"; } [/code]

Member Avatar for mrnutty
0
86
Member Avatar for jamshed ahmed

i am assuming that you have customer_id column in both tables. I have joined using customer_id instead of agent_id [code] SELECT Customer_Info.CustName,Customer_Info.Address,Customer_Bank_Info.CustChequeNo,Customer_Bank_Info.CustAccountNoFROM Customer_Info,Customer_Bank_InfoWHERE Customer_Info.AgentID=Customer_Bank_Info.AgentIDSELECT Customer_Info.CustName,Customer_Info.Address,Customer_Bank_Info.CustChequeNo,Customer_Bank_Info.CustAccountNo from Customer_Info,Customer_Bank_Info WHERE Customer_Info.customerID=Customer_Bank_Info.customerID [/code]

Member Avatar for jamshed ahmed
0
155
Member Avatar for end3r

[code] SELECT sum(case when isnull(my_table.entry,0) > 0 AND my_table.edate = convert(datetime,substring('2009-09-20',1,10)) THEN 1 else 0 END) AS no_entries_date1, sum(case when isnull(my_table.entry,0) > 0 AND my_table.edate = convert(datetime,substring('2009-09-21',1,10)) THEN 1 else 0 END) AS no_entries_date2, sum(case when isnull(my_table.entry,0) > 0 AND my_table.edate = convert(datetime,substring('2009-09-22',1,10)) THEN 1 else 0 END) AS no_entries_date3 …

Member Avatar for end3r
0
98
Member Avatar for ismael ahm@d

You should write following query in you selected.php page. [code] select * from table_name where date between '{$_REQUEST['from_date']}' and '{$_REQUEST['to_date']}' [/code]

Member Avatar for ismael ahm@d
0
96
Member Avatar for billmudry

I think you are making one minor mistake intead of != you must use = sign in join condition. [code] INSERT INTO species_master (genera, name, species_name, authorities, species_source) SELECT DISTINCT genera, name, species_name, authorities, species_source FROM tervuren_target LEFT JOIN species_master ON tervuren_target.species_name = species_master.species_name WHERE species_master.species_name IS NULL [/code]

Member Avatar for urtrivedi
0
177
Member Avatar for adxer

You are confused between two separate environments. You can not ask user to input data in between. Javascript may access values from html input elements.

Member Avatar for rajarajan2017
0
132
Member Avatar for nonshatter

you may add following code between line no 16 and 18 [code] $countofrecs=mysql_query("SELECT count(*) from auctions WHERE a_title LIKE '%".$searchterm."%' OR category_id = '$catid'"); $cnt=mysql_fetch_assoc($countofrecs) ; echo "Your search terms returned '{$cnt[0]}' results"; [/code]

Member Avatar for Virtualbase
0
2K
Member Avatar for bsewell
Member Avatar for Virtualbase
0
285
Member Avatar for tyson.crouch
Member Avatar for tyson.crouch
0
59
Member Avatar for urtrivedi

Dear Members/Moderators Hi, It is good to see newly designed website. But I think whenever you upgrade anything it should not loose the old features. We may keep on adding things but without we must retain old features. When ever we used to open old website. 1) We were able …

0
97
Member Avatar for stefano28

If you are not from IT background start learning database with MS access. php/mysql will be difficult to start with for you.

Member Avatar for diafol
0
112
Member Avatar for imanpatrick

Most of things are available in PHP as compared to C/C++. When ever you code something say sorting, searching array. do not start writing loops, find functions in php. You will always find something related to your requirements, in manuals. Everybody know how to code but it is worthless to …

Member Avatar for jayreis
0
104
Member Avatar for bsewell

You have syntax error in following line numbers of your code line no. 3. fgetcsv($handle[B])[/B],500,"^")) // remove UNWANTED ) AFTER $HANDLE line no. 8. write [b]$row++[/b] instead of row++ line no. 11. for ($c=0;$c<$num;[b]$c++[/b]) // WRITE $c++ instead of c++

Member Avatar for bsewell
0
158
Member Avatar for jellybeannn

You must intialize your javascript variable in line number 2 of your code [code] var estimatedCost=0; [/code]

Member Avatar for fxm
0
112
Member Avatar for shine_jose

[code] <html> <head> <script lang='javascript'> function btn1_click() { //do something; alert('in btn1_click function'); } </script> </head> <body> <input type='button' value='click me' id='btn1' name='btn1' onclick='javascript:btn1_click();' > </body> </html> [/code]

Member Avatar for vishal18
0
99
Member Avatar for Larry_b

YOu may use $_REQUEST array without any trouble. It will contain both post and get data from previous page.

Member Avatar for rajarajan2017
0
84
Member Avatar for rogerkore

[code] select * from something where name1 in ('roger','dubs','chill','lee') and name2 in ('roger','dubs','chill','lee') and name3 in ('roger','dubs','chill','lee') and name4 in ('roger','dubs','chill','lee') [/code]

Member Avatar for diafol
0
414
Member Avatar for sdimantova

I have changed your line no 2 [CODE] SELECT arp.DisplayName0, (case when arp.DisplayName0='Microsoft Office Standard 2007' THEN arp.DisplayName0 ELSE '' END) AS ResourceID2007, count(*) AS TotalTarget, round(100.0*count(case when arp.DisplayName0='Microsoft Office Standard 2007' THEN 1 ELSE 0 END)/count(*),1) AS Office2007StdPct FROM v_Add_Remove_Programs arp INNER JOIN v_CM_RES_COLL_MI100017 coll ON arp.ResourceID=coll.ResourceID INNER JOIN …

Member Avatar for sdimantova
0
166
Member Avatar for cristina.h

You echo query on screen copy it and try to run in mysql directly may be on mysql command prompt or phpmyadmin. Check whether your query works directly to backend or not. keep echo statment before calling mysql_query() function. [code] echo $query_add_tarife."<br>"; echo $query_add_facilitati."<br>"; [/code]

Member Avatar for urtrivedi
0
102
Member Avatar for sivaprakashm

i am changing your line no 14 and 16 [code] SET @temp = SELECT count(*) FROM approved_man_power WHERE department_id = @department_id AND fy_id= @fy_id AND vertical_id = @vertical_id IF isnull(@temp,0) = 0 [/code] Do not post your probles in code snippet. Post it as Forum Thread.

Member Avatar for urtrivedi
0
111
Member Avatar for luap599

You may continue inserting using following statement [code] if($_POST[opt_yn1] != 'n'){ $opt = "insert into user_req_opt(rq_id, opt_ref, opt_value) values('".$qid."', '".$_POST[opt_ref1]."', '".$_POST[opt_value1]."')";$result = mysqli_query($mysqli, $opt) OR die (mysqli_error($mysqli)); } if($_POST[opt_yn2] != 'n'){ $opt = "insert into user_req_opt(rq_id, opt_ref, opt_value) values('".$qid."', '".$_POST[opt_ref2]."', '".$_POST[opt_value2]."')";$result = mysqli_query($mysqli, $opt) OR die (mysqli_error($mysqli)); } . . …

Member Avatar for luap599
0
173
Member Avatar for js8765

you may use left, right outer joins to control result as expected. [code] select t1.col1,t1.col2, t2.col1, t2.col2 from db1.table1 t1 left outer join db2.table2 t2 on t1.CommonColName=t2.CommanColName [/code]

Member Avatar for js8765
0
788

The End.