urtrivedi 276 Nearly a Posting Virtuoso
<input name="hiddenfield" type=hidden value='somevalue'>

User will not able to view the field but still it will be posted along with other form elements.

urtrivedi 276 Nearly a Posting Virtuoso

Which solution worked?

urtrivedi 276 Nearly a Posting Virtuoso

in your index.php, change line no 14, pass connection resource and then try.


$rs=mysql_query($query, $con);

urtrivedi 276 Nearly a Posting Virtuoso

for page authentication I use to do following steps
1) When user loggs in I store permitted page names from database for the user in a session arrary
2) In every page I call permission.php file, which checks requested page ($_SERVER ) is there in page session array set in step 1.

urtrivedi 276 Nearly a Posting Virtuoso

use str_to_date() function of mysql

$sql = "INSERT INTO submissionfiledata "."(date,Name,FromEmailid,PhoneNumber,CountryName) "."VALUES " .
"(str_to_date('{$date}' ,'%M %d %Y') ,  '$name','$emailid', '$phone','$country')";
urtrivedi 276 Nearly a Posting Virtuoso

You need to write following code in "BookingForm.php" page. Remove this code from your registration page. Becuase when registration page is opened nothting is posted to it, so blank row is inserted.

<?php
$con = mysql_connect("localhost","root","password");
if (!$con) 
 { 
 die('Could not connect: ' . mysql_error());  }
 mysql_select_db("ambos", $con); mysql_query("INSERT INTO customer (ic_no, name, address, tel_no, email)VALUES ('$_POST[ic_no]', '$_POST[name]', '$_POST[address]','$_POST[tel_no]','$_POST[email]')");
mysql_close($con);
?>
urtrivedi 276 Nearly a Posting Virtuoso

I am not sure about the error. It seems there there is some problem with some of the row. are you able to query two tables separtely without joining?. You empty both tables and then again insert fresh rows.

And now about your query. I have corrected your query as given below

SELECT personal_details.fn, training.training_level 
FROM personal_details INNER JOIN training 
ON personal_details.staff_ID = training.staff_id 
where personal_details.staff_id='" + detailsFrm.Label13.Text + "'

You must complete the join condition, the filter record with where clause.

urtrivedi 276 Nearly a Posting Virtuoso

Where is the query? Anyways following query may help you.
Always use table alias before column name when you are querying more than one table.

select p.staff_ID , p.title , p.fn , p.ln ,
t.training_id, t.training_level, t.school_name, t.training_date
from personal_details p
inner join training t on t.staff_id=p.staff_id
urtrivedi 276 Nearly a Posting Virtuoso

1) You type here the expected output of query instead of giving only problem statementl.
2) Where are your product1.... product6 table structures?
3) what difference/similarities/relation between user and client table?

urtrivedi 276 Nearly a Posting Virtuoso
select sum(sub_amt) total_due from (
select sum(amount)  sub_amt from product1 where date is null
union
select sum(amount)   sub_amt from product2 where date is null
union
select sum(amount)   sub_amt from product3 where date is null
union
select sum(amount)   sub_amt from product4 where date is null
union
select sum(amount)   sub_amt from product5 where date is null
union
select sum(amount)   sub_amt from product6 where date is null
) a
urtrivedi 276 Nearly a Posting Virtuoso

Print and check whether your page is getting the values properly or not, by keeping following code in the begining of your page.

echo "<pre>";
print_r($_GET);
echo "</pre>";
urtrivedi 276 Nearly a Posting Virtuoso

Replace whole line no 163 of your posted code, with the code line posted by me on search page.

urtrivedi 276 Nearly a Posting Virtuoso

Change line no 163 as given below

echo "<td>";echo "<a href='http://localhost/sdc/?q=node/3&CP_ID={$row['CP_ID']}'>";echo $row['CP_ID'];echo "</td>";

Now in your edit page you will get value of clicked CP_ID in
$_REQUEST variable.

urtrivedi 276 Nearly a Posting Virtuoso
select a.debt_id ,a.data_insertion , a.debt_date,a.amount,
a.paidback,a.customer_id,a.agent_id,
c.operation_id,c.data,c.amount,c.customer_id,c.debt_id,c.optype
from debt a left outer join 
		(
			select debt_id,max(operation_id) as last_operation_id 
			from history group by debt_id
		) b on a.debt_id=c.dept_id
left outer join history c on b.last_operation_id=c.operation_id
urtrivedi 276 Nearly a Posting Virtuoso
update enrolled set grade= case when marks <35 then 'F'
                    when marks>=35 and marks <45 then 'D'
                    when marks>=45 and marks <55 then 'C'
                    when marks>=55 and marks <65 then 'B'
ELSE 'A' END
urtrivedi 276 Nearly a Posting Virtuoso

just added , wins*3 points in first line

select team, wins, wins*3 points
from (
select hometeam team, count(*) wins
from fixtures
where competitionname = 'prem'and homepoints = '3'
group by hometeam
union
select awayteam team, count(*) wins
from fixtures
where competitionname = 'prem' and awaypoints = '3'
group by awayteam
) tmp
group by team
urtrivedi 276 Nearly a Posting Virtuoso
insert into desttable (idcol,col2,col3) select idcol+100, col2, col3 from sourcetable
urtrivedi 276 Nearly a Posting Virtuoso
SELECT f.forumname,f.forumdesc,count(*) as total_topics from Forum as f 
INNER JOIN Topic as t WHERE f.forumid = t.forumid
group by f.forumname,f.forumdesc;
urtrivedi 276 Nearly a Posting Virtuoso

there is no limit on joining same table again.

SELECT Brochure.*, Leaders.Name, la.name as asst_name FROM Brochure LEFT JOIN Leaders ON Brochure.Leader=Leaders.ID 
left outer join leaders as LA on Brochure.Leader_asst=La.ID 
WHERE Brochure='2010 spring' AND Activity='biking' ORDER BY Date_Full
urtrivedi 276 Nearly a Posting Virtuoso

If you place <br> it will always break your line in browser. If your aim is readablility then why don`t you simply press enter key where ever you want to break your line for your view, instead of typing <br>?

urtrivedi 276 Nearly a Posting Virtuoso

add some thing (given below) to you dropdown code

"><select name="product" id="product" onchange='javascript:document.getElementByID("barcode").value=this.value;'>
urtrivedi 276 Nearly a Posting Virtuoso

1) add two columns newlastname and newname
2) update them with lastname and name
3) drop columns name and lastname
4) rename newlastname to lastname and newname to name

urtrivedi 276 Nearly a Posting Virtuoso

find the actual build query on screen using echo statement. then copy that whole query and run it in phpmyadmin or whatever mysql interface you use. check whether query is working at backend or not.

$sqlFilter .= ' AND (username LIKE "%'.$_SESSION['filter']['filterusername'].'%" OR active LIKE "%'.$_SESSION['filter']['filteractive'].'%" )';

echo $query.$sqlFilter
urtrivedi 276 Nearly a Posting Virtuoso

You upload your sql file of two table with sample data. and post here sample expected output from that data, then I am able to help you.

urtrivedi 276 Nearly a Posting Virtuoso
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']);
urtrivedi 276 Nearly a Posting Virtuoso

use $_SERVER variable to find which page was referred by user before login. In login page above variable will contain the page name from which login is called. so after successfull login check, transfer to url in above variable.

urtrivedi 276 Nearly a Posting Virtuoso

You should pass date in yyyy-mm-dd format to mysql server

urtrivedi 276 Nearly a Posting Virtuoso

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.......

urtrivedi 276 Nearly a Posting Virtuoso

Have you got the expected result?

urtrivedi 276 Nearly a Posting Virtuoso

Insert following code at line no 60. and see whether it is fetching correct data or not

print"<pre>";
var_dump($datauserrow);
print"</pre>";
urtrivedi 276 Nearly a Posting Virtuoso

use following query for expected result

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
urtrivedi 276 Nearly a Posting Virtuoso

set auto index for your new table using following query

ALTER TABLE tbl AUTO_INCREMENT = 100;
urtrivedi 276 Nearly a Posting Virtuoso
Select * from lease_north a  
inner join  lims_payment b on a.siteid=b.siteid
WHERE a.LaStartDate like '%-04-%' and b.pdate like '%-03-%'
urtrivedi 276 Nearly a Posting Virtuoso

which field(s) is link between the two table, and what is the cardinality one-many or many to one between these tables.

urtrivedi 276 Nearly a Posting Virtuoso

Following query will give all student name which are in student table

select a.studid, a.studname, b.address, b.phone from student a left 
outer join address b on a.studid=b.studid

Following query will give only those student details which are in both table

select a.studid, a.studname, b.address, b.phone from student a inner join address b on a.studid=b.studid
urtrivedi 276 Nearly a Posting Virtuoso

Without gateway.
You need to configure hardware with your server. buy sms package and then write a code to send sms.

urtrivedi 276 Nearly a Posting Virtuoso

You may find following post useful
http://www.daniweb.com/forums/thread239929.html

urtrivedi 276 Nearly a Posting Virtuoso

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.

urtrivedi 276 Nearly a Posting Virtuoso

-

urtrivedi 276 Nearly a Posting Virtuoso

Following code will give you exactly the required output i.e.
1 4 7
2 5 8
3 6

1) First create blank HTML table by finding rows and colmns, define id of each table cell
2) At the end of page using php/javascript write data into appropriate table cell.

<?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	
?>
<html>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
    <td height="5"></td>
  </tr>
<?php
	$count=count($result_array); //no of rows in table 
	$noofcols=5
	$rows=ceil($count/$noofcols);  //no of columns you want to break here it is 5

	$i=0;
	for($k=0;$k<$rows;$k++)
	{
?>
  <tr>
	
	<?php 
		for($j=0;$j<$noofcols;$j++)
		{                    		
	?>
    <td valign="top" id='cell<?php echo $k.$j?>'> 		&nbsp;    </td>
	<?php 
			$i++;
		}
	?>
    
  </tr>
  <?php
	}
	
?>
</table>
</body>

<?php

	$index=0;
	echo "\n<script lang='javascript'>";
	for ($i=0;$i<$noofcols;$i++)
	{
		for ($j=0;$j<$rows;$j++)
		{
		 
			echo "\ndocument.getElementById('cell{$j}{$i}').innerHTML='<a href=\"referecne_page.php?stateid={$result_array[$i]['state_id']}\" class=\"links\">{$result_array[$i]['state_name']}</a>';";

	 		$index++;
		}	
	}
	echo "\n</script>";
	
	
?>

</html>
urtrivedi 276 Nearly a Posting Virtuoso

I am not exploding $one and using our own code with minor changes. I am only changing condition and echoing only selected instead of selected="selected"

<body>
<select name="city[]" size=5 multiple="multiple">
<option value="pune"<?php if (substr_count($one, 'pune')  > 0  )
{ 
echo
'selected';
} ?>>pune</option>
<option value="mumbai"<?php if (substr_count($one, 'mumbai')  > 0) { echo
'selected'; } ?>>mumbai</option>
<option value="nasik"<?php if (substr_count($one, 'nasik')  > 0) { echo
'selected' ;} ?>>nasik</option>
<option value="surat"<?php if (substr_count($one, 'surat')  > 0) { echo
'selected'; } ?>>surat</option>
<option value="dhule"<?php if (substr_count($one, 'dhule')  > 0) { echo
'selected'; } ?>>dhule</option>

</select>                     
</body>
urtrivedi 276 Nearly a Posting Virtuoso
SELECT concat(date_format(frm_dt,'%d-%m-%Y'),' - ',date_format(to_dt,'%d-%m-%Y'))  period FROM `tablename`

or

SELECT concat(frm_dt,' - ',to_dt)  FROM `tablename`
urtrivedi 276 Nearly a Posting Virtuoso

Below code will display you data in following way
1 2 3 4 5
6 7 8 9 10
......

<?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 height="5"></td>
  </tr>
<?php
	$count=count($result_array); //no of rows in table 
	$noofcols=5
	$rows=ceil($count/$noofcols);  //no of columns you want to break here it is 5

	$i=0;
	for($k=0;$k<$rows;$k++)
	{
?>
  <tr>
	
	<?php 
		for($j=0;$j<$noofcols;$j++)
		{                    		
	?>
    <td valign="top">

    <a href="referecne_page.php?stateid=<?php echo $result_array[$i]['state_id'];?>" class="links"><?php echo $result_array[$i]['state_name'];?></a>
    </td>
	<?php 
			$i++;
		}
	?>
    
  </tr>
  <?php
	}
?>
</table>
urtrivedi 276 Nearly a Posting Virtuoso
SELECT COUNT(*) as totalProduct               
 FROM customers                
INNER JOIN uploads ON customers.id = uploads.fk_id                
where name='MyRequiredName'
GROUP BY name
urtrivedi 276 Nearly a Posting Virtuoso

use date_format() function in your sql query

$query="select date_format(startdate, '%d/%m/%Y') as startdate, col1,col2,col2 from mytable where col1='mycondition'";
urtrivedi 276 Nearly a Posting Virtuoso

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.

urtrivedi 276 Nearly a Posting Virtuoso

(note: both provide the exact same output)

I posted because of above quote and just to save newbies from confusion.

urtrivedi 276 Nearly a Posting Virtuoso

Remove phrase "group by name" from your query.

urtrivedi 276 Nearly a Posting Virtuoso

Remove " double quote which are around your table name war.

$result = mysql_query("SELECT * FROM `war` WHERE `user_name`='".$_POST['u_name']."' ");
urtrivedi 276 Nearly a Posting Virtuoso

You can not do anything without loop.
Correct code is as follows

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";
	}

}