1,257 Posted Topics
Re: [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] | |
Re: use == for comparision at line no 28 (++$i % 2) == 0 ![]() | |
Re: file permission may be the issue on your server. | |
Re: 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 = … ![]() | |
Re: [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 | |
Re: 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. | |
Re: [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] | |
Re: 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] … | |
Re: [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] | |
Re: [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] | |
Re: [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] ![]() | |
Re: [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] | |
Re: use braces {} around php variables like shown below print "<option value=\"{$SourceID}\" {$selected}> {$ItemName} </option>"; ![]() | |
Re: [ 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 ![]() | |
Re: what do mean by not working? syntax, query or what? | |
Re: 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. | |
Re: if you want more than one trailing or leading spaces then " " is the only way to do it. | |
Re: 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 … | |
Re: 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` ) … | |
Re: 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 * … | |
Re: after removing <? ?> tags then use htmlentities function to output html code on browser. echo htmlentities("your html string"); | |
Re: 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'"); | |
Re: 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. … | |
Re: 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 … | |
Re: [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] | |
Re: 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. | |
Re: 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] | |
Re: 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] | |
Re: 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] | |
Re: [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 … | |
Re: 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] | |
Re: 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] | |
Re: 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. ![]() | |
Re: 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] | |
Re: exit after redirection [code] header('location: edit.php'); exit; [/code] | |
Re: Inner and natural are same left and rigth are used with outer join. | |
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 … | |
Re: If you are not from IT background start learning database with MS access. php/mysql will be difficult to start with for you. ![]() | |
Re: 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 … | |
Re: 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++ | |
Re: You must intialize your javascript variable in line number 2 of your code [code] var estimatedCost=0; [/code] | |
Re: [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] | |
Re: YOu may use $_REQUEST array without any trouble. It will contain both post and get data from previous page. ![]() | |
Re: [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] ![]() | |
Re: 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 … | |
Re: 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] | |
Re: 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. | |
Re: 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)); } . . … | |
Re: 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] |
The End.