1,257 Posted Topics

Member Avatar for karet

use following query for expected result [code] SELECT concat(min(TGL ),' till ',max(TGL )) as tgl_libur, concat(tahun,'-',semester) as tahun_semester, kererangan FROM `table_name` group by tahun,semester , keterangan [/code]

Member Avatar for asaizanm
0
71
Member Avatar for cane23

[code] if (isset($_SESSION['y1sem1'])) $new=array_merge($_SESSION['y1sem1']); if (isset($_SESSION['y2sem1']) && isset($new)) $new=array_merge($new,$d_SESSION['y2sem1']); elseif (isset($_SESSION['y2sem1']) && !isset($new)) $new=array_merge($_SESSION['y2sem1']); if (isset($_SESSION['y3sem1']) && isset($new)) $new=array_merge($new,$_SESSION['y3sem1']); elseif (isset($_SESSION['y3sem1']) && !isset($new)) $new=array_merge($_SESSION['y3sem1']); [/code]

Member Avatar for as.bhanuprakash
0
87
Member Avatar for lisles
Member Avatar for urtrivedi
0
87
Member Avatar for codeblock

Insert following code at line no 60. and see whether it is fetching correct data or not [code] print"<pre>"; var_dump($datauserrow); print"</pre>"; [/code]

Member Avatar for Will Gresham
0
160
Member Avatar for DevC++4.9.9.2

1) You join all table that are required for query. 2)apply appropriate where condition on all columns 3) write query select distinct name, address from your tables joins condition.......

Member Avatar for urtrivedi
0
57
Member Avatar for ravikumar111

Following query will give all student name which are in student table [code]select a.studid, a.studname, b.address, b.phone from student a left outer join address b on a.studid=b.studid [/code] Following query will give only those student details which are in both table [code]select a.studid, a.studname, b.address, b.phone from student a inner …

Member Avatar for urtrivedi
0
66
Member Avatar for s_kanika

You may find following post useful [URL="http://www.daniweb.com/forums/thread239929.html"]http://www.daniweb.com/forums/thread239929.html[/URL]

Member Avatar for vsmash
0
78
Member Avatar for veledrom
Member Avatar for veledrom
0
95
Member Avatar for wayne sd

id, customer_id, water_records_date, water_records_usage 1, '1', '2010-02-01', '226600' 2, '1', '2010-01-01', '223000' 3, '4', '2010-01-05', '5600' 9, '4', '2010-02-19', '88000' 15, '5', '2010-02-15', '10060' 19, '5', '2009-12-02', '9000' 21, '9', '2010-02-19', '10500' 22, '9', '2009-12-02', '8900' Above is your input, Do specify how you want the ouput.

Member Avatar for wayne sd
0
122
Member Avatar for pavithraCS

[code] SELECT concat(date_format(frm_dt,'%d-%m-%Y'),' - ',date_format(to_dt,'%d-%m-%Y')) period FROM `tablename` [/code] or [code] SELECT concat(frm_dt,' - ',to_dt) FROM `tablename` [/code]

Member Avatar for drjohn
0
73
Member Avatar for muralibobby2015

Below code will display you data in following way 1 2 3 4 5 6 7 8 9 10 ...... [code] <?php $query = "select state_id,state_name from statemaster a "; $result_array =execute(query);; //you must use proper syntax to bring data in $result_array ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td …

Member Avatar for urtrivedi
0
112
Member Avatar for baseballfury

use date_format() function in your sql query [code] $query="select date_format(startdate, '%d/%m/%Y') as startdate, col1,col2,col2 from mytable where col1='mycondition'"; [/code]

Member Avatar for baseballfury
0
2K
Member Avatar for Pooja J.

Following code may help you [code] <html> <body> <form> <!-- copy following php code at the place where you are populating your list box--> <?php /* set $mywholearray from database this array contains all master values to be shown in listbox $mywholearray[0]['id']='pkvalue', $mywholearray[0]['desc']='description', */ /*set $myselarray from database this array …

Member Avatar for urtrivedi
0
112
Member Avatar for kevindougans

You can not do anything without loop. Correct code is as follows [code] if ($no_of_types > 0) { while ($overhead_type_info = mysql_fetch_assoc($sql_result)) { extract($overhead_type_info); echo "<br>$rid, $type, $summary, $details, $cost, $purchase_date"; } } [/code]

Member Avatar for pbcomput
3
207
Member Avatar for JSHGROUP

It will always post what ever is on your form. So you must check whether value>0 then add that item is value is 0 or null then ignore that item.

Member Avatar for misterrmac
0
136
Member Avatar for venusseo

Remove " double quote which are around your table name war. [code] $result = mysql_query("SELECT * FROM `war` WHERE `user_name`='".$_POST['u_name']."' "); [/code]

Member Avatar for urtrivedi
0
74
Member Avatar for dylank

You must write your php password verification code at the end of page. Your div tag is rendered at the end of your code. So if you want to set innerhtml in div tag, you must do it after div is rendered on the browser. [code] ... . . </body> …

Member Avatar for NettSite
0
160
Member Avatar for dumbncool
Member Avatar for Zingar

If you want to synchronize two database on separte server then you need to write some code which will read and update data on another server OR if you just want to keep backup of database on difference location then below is the one way of doing it. 1) You …

Member Avatar for jaasaria
0
103
Member Avatar for rledesma

[CODE] SELECT students.last_name, students.first_name, students.grade_level, CC1.last_name HOMETEACHER, CC2.last_name PETEACHER, CC2.PERIOD, students.student_number FROM students JOIN ( SELECT cc.studentid,teachers.last_name from CC JOIN teachers ON teachers.id = cc.teacherid WHERE (cc.course_number >= 28001 AND cc.course_number <= 28007) AND cc.dateleft = '24-JUN-10'AND cc.expression = '1(A)' )CC1 ON students.id = cc1.studentid JOIN ( SELECT cc.studentid,teachers.last_name, SUBSTR(cc.expression, …

Member Avatar for rledesma
0
103
Member Avatar for ronaldpaul

Family Master (all common details will come under this table) family_id, fam_address, fam_city, fam_phone) Member_master (all member related details along with family id will come under this table) member_id family_id ( foreign key from above table) member_name member_birthdate

Member Avatar for urtrivedi
0
168
Member Avatar for ashab27

1) You must keep one variable or property which will store current id being stored currquesID=1; 2) I am assuming that your question ID is numeric. 3) in nextquestion button code find minmum question number which is greater than cuRRquestID 4) load data with the found next question no. 5) …

Member Avatar for urtrivedi
0
199
Member Avatar for liro0917
Member Avatar for urtrivedi
0
125
Member Avatar for preetg

If the string length is fixed then you can use "substr" function instead of explode. 1) Read one line at time into a variable $dataline=readnextline($filepointer); 2) store output of substr function in proper column variable $col1=substr($dataline,1,3); $col2=substr($dataline,5,1); 3) then build a insert /update query using column variables insert into table1 …

Member Avatar for urtrivedi
0
173
Member Avatar for MDanz

You can set dynamic javascript code using php variable using following code. [code] <script lang='javascript'> window.location='page<?php echo $var?>.php'; </script> [/code]

Member Avatar for urtrivedi
0
47
Member Avatar for gungrave12

[code] select DISTINCT a.cust_num, a.phone from customer a inner join orders b on a.cust_num=b.cust_num inner join menu c on c.food_name=b.food_name where c.food_type='SOUP' OR (b.food_name='hamburgers' and b.quantity=3) [/code]

Member Avatar for urtrivedi
0
82
Member Avatar for ausmaya

use quotes around [code] function changeImage(obj) { obj.src ="creek.jpg"; obj.src = "dock.jpg"; } [/code] creek will be ignored and dock will be displayed. why you are doing so?

Member Avatar for urtrivedi
0
103
Member Avatar for theshakti

Following query will help you. Here I assume that you have whole data string in "mytable" in column "data". Also I assume that same table contains all other 5 column. For column 1 index is -5, for 2 index is -4 and so on. [code] update table mytable set category=substr(substring_index(data,'>',-5),1,instr(substring_index(data,'>',-5),';')-1), …

Member Avatar for theshakti
0
291
Member Avatar for whiteyoh

following code will return age in days for each user [code] SELECT username,datediff( current_date( ) , birthdate ) FROM datatable [/code]

Member Avatar for vharuna
0
100
Member Avatar for plc
Re: $

Variables in PHP are represented by a dollar sign followed by the name of the variable. The variable name is case-sensitive.

Member Avatar for harshbavaliya
-4
122
Member Avatar for bahr_alhalak

I have attached one file. I think you need three table. I am not sure why you have used book table and reverse table. I have used only user, bookinfo and borrow tables.

Member Avatar for bahr_alhalak
-1
93
Member Avatar for kuteinheart

try following code in your validation function [code] else if(form1.date5.value=='0000-00-00') { alert('Select the Start Date'); form1.focus(); return false; } [/code]

Member Avatar for kuteinheart
0
105
Member Avatar for tryphy

You need to do it manually i dont think mysql will do it automatically First you may determine the max no using following query and then you may use it while inserting a new record [code] //determine id //$id=SELECT max(substr(rollno,2))+1 FROM `alumni_job`; $id='c'.$id; insert into table (comp_id,name) values ('$id','$name'); [/code]

Member Avatar for phpbeginners
0
117
Member Avatar for s2xi

Follow steps given below 1) Keep same column in both table with same data type say AGENT_ID. 2) keep this as primary key in both tables 3) In agent_users table keep it as auto_increment, DO NOT set agent_id as auto_increment in agent_company table. 4) In your mysql code first insert …

Member Avatar for urtrivedi
0
135
Member Avatar for cailles20_1009

1) Your move_uploaded_file() need semicolon at the end 2) your last else( for invalid file message) is without if [code] <?php $target="upload/"; $basename=basename($_FILES["file"]["name"]); $target=$target . basename($_FILES["file"]["name"]); if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br …

Member Avatar for urtrivedi
0
49
Member Avatar for aneeka

[code]<input name='answer[]' type='text'>";[/code] use above html code then you will get arrary of answer text box in php when form is submited

Member Avatar for tomatocms
0
100
Member Avatar for tunde011
Member Avatar for madristaa

It may happen if second page is refreshed continuously. After inserting you redirect browser to another or first page. Also use cookies.

Member Avatar for accountholder
0
87
Member Avatar for ayesha789
Member Avatar for sethm

In your php code Before inserting or updating. use follwoing code [code] insertquery="insert into mytable (col1,col2,date1) values('val1','val2', date_format(".$_POST['htmldatefieldname']."'%Y-%m-%d') )" [/code]

Member Avatar for sethm
0
165
Member Avatar for hno

I guess you want to show some message or tool tip when someone moves mouse over your image. add highligted text in your code [code] <table width="80%"> <tr> <td align="center" ><img src="10000000.png" width="100%" height="60px" [b] title ='this is test' [/b]/> ><span style="overflow:hidden"> test </span></td></tr></table> [/code]

Member Avatar for millermccullum
0
89
Member Avatar for ayesha789

Following code may help you. I am assuming that your ch value is number. [code] <script lang='javascript'> function openform(chval) { document.frm.chvalue=chval; document.frm.submit(); } </script> <html> echo "<form name=frm method=post action=actionpage.php target='_blank'>"; echo "<table>"; echo "<tr>"; echo "<th bgcolor=#FFCC66>Image</th>"; echo "<td bgcolor=#FFE375><input type=button value='View' onclick=' javascript:openform(".$row['ch'].") ;' > </td>"; echo "</tr>"; …

Member Avatar for musthafa.aj
0
100
Member Avatar for lifeworks

Your query seems to be ok, though I have changed last line. Let me know what result /error are you getting. [code] $sql = "SELECT s.name,COUNT(a.id),COUNT(r.id) FROM product_items AS i LEFT JOIN watch_addtocart AS a ON a.id = i.id LEFT JOIN watch_removefromcart AS r ON r.id = i.id LEFT JOIN …

Member Avatar for lifeworks
0
105
Member Avatar for ssa01

What error are you getting. also specify cardinality of the tables.

Member Avatar for debasisdas
0
103
Member Avatar for urtrivedi

What is default DBMS system in MAC. Also is there any way to develope dbms application in windows and run that file on mac os. In short which is the dbms software which which can work on both mac and windows platform?

Member Avatar for jbennet
0
152
Member Avatar for R3Slick

I am modifying line 10 to 12. [code] $method=$_POST['searchType']; if ($method=='EmployeeId') $condition="(EmployeeId = '$search' or EmployeeFname = '$search')"; else $condition="$method = '$search'"; $search=$_POST['query']; $query = mysql_query("SELECT * FROM Employee WHERE $condition"); [/code]

Member Avatar for R3Slick
0
108
Member Avatar for mpierre

You have not passed conection parameter. change you code as given below. [code] [b] $conn = mysql_connect("servername","username","password");[/b] $sql = mysql_query("SELECT * FROM forum_posts WHERE type='a' ORDER BY date_time DESC LIMIT 0, 30"[b],$conn[/b]); [/code]

Member Avatar for venkat0904
0
93
Member Avatar for aruti
Member Avatar for Tahseen79

I am attaching a document which may help you in undestanding and mapping your needs to it.

Member Avatar for Ezzaral
0
154
Member Avatar for blessanm

You need not to do it in query, you can do that it one loop using php code. Also you need to add order by statment at the end of your query. i.e. [b]order by index,orderindex[/b] [code] $resulthdr = oci_parse($connection, $queryhdr); if (!(oci_execute($resulthdr))) showerror(); print "\n<font face='sans-serif' size=1 color=#000000>"; print …

Member Avatar for urtrivedi
0
126

The End.