urtrivedi 276 Nearly a Posting Virtuoso
if (trim($Type1)=='Burger' ) {
{
header("Location: burgerthanks.htm"); //the user will be sent to this page
exit;
}
if (trim($Type1)=='Farm']) {
header('Location: option2.htm');
exit;
} else
header('Location: thanks1.htm');
exit;
urtrivedi 276 Nearly a Posting Virtuoso

You want return status so I would suggest you to create function in mysql

http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html

urtrivedi 276 Nearly a Posting Virtuoso

1) Export database from one
2) you must check whether there is table name conflict or not.
3) you need to import exported file to first one
4) change code in pages where second database is used.

urtrivedi 276 Nearly a Posting Virtuoso

You must use loop to display the multiple result

while($row = mysql_fetch_array( $result ))
{
      echo "Name: ".$row['name']." ";
      echo " Age: ".$row['age']."<br>";
}
urtrivedi 276 Nearly a Posting Virtuoso

You are almost done, just add column names in the select list you want to access. Your query is alright.

$query="SELECT userprofile.profpic, userprofile.lastname, userprofile.firstname FROM userprofile INNER JOIN accntinfos ON accntinfos.accntnum=userprofile.accntnum";
urtrivedi 276 Nearly a Posting Virtuoso

isset check whether the variable exists or not , it returns true even if the value is blank. so you may check accordingly like

if (isset ($Type1['Burger']) && trim($Type1['Burger'])!='' ) {
{
header("Location: burgerthanks.htm"); //the user will be sent to this page
exit;
}
if (isset ($Type1['Farm']) && trim($Type1['Farm'])!='' ) {
header('Location: option2.htm');
exit;
} else
header('Location: thanks1.htm');
exit;
urtrivedi 276 Nearly a Posting Virtuoso

change line number 24 to

if($search > 0){
urtrivedi 276 Nearly a Posting Virtuoso

I agree with the solution provided by adam_k

SELECT Col1 + CHAR(13) + CHAR(10) + Col2 FROM test

It may not shown in query result. but in text area or in your multi line text box new line will be visible.

urtrivedi 276 Nearly a Posting Virtuoso

This is very well explained, but I still need the sql script of 2 tables with sample data.

Sample data means, you give say 100 rows in one table and some more rows in source table. So that we can help you build the exact query.

urtrivedi 276 Nearly a Posting Virtuoso

I think there is no way to format number in java script to thousand separator, you need to create your own function.

urtrivedi 276 Nearly a Posting Virtuoso
<html>
<head> </head>
<script lang='javascript'>
var amount1=" 12,345,678.10 ";
var amount2="87,246,125.00";

re = /,/gi;
var d=parseFloat(amount1.replace(re, ""))
       +parseFloat(amount2.replace(re, ""));

alert(d);
</script>

</html>
urtrivedi 276 Nearly a Posting Virtuoso

Problem is in your primary key.
I guess you want to update all item related to say body number 1 at the same time.

But you must also need one key to identify row in the table paint shop.

So your update statement is using only one where condition. You must add one more condition to identify the specific row update.


Also I would suggest not to allow updating primary key of table.

If you are still not clear, post your paintshop table definition (sql) here.

urtrivedi 276 Nearly a Posting Virtuoso
<html>
<head> </head>
<script lang='javascript'>
var amount1=12345678.10;
var amount2=87246125.00;
var d=amount1.valueOf()+amount2.valueOf();
alert(d);
</script>

</html>
urtrivedi 276 Nearly a Posting Virtuoso

Start with php tag. Do not keep any space, newline or any Character in the beginning. Here <body> and newline creating problem.

<?php     
//start session    
session_start();     
include("includes/header.php");
//unset any session data until user submits valid username and password    
// this is correct way not unset($_SESSION), sorry my mistake    
// see http://www.php.net/manual/en/function.session-unset.php    

session_unset();    
session_destroy(); 
?>
<body>
<div id="login">
      
      <form action="proseslogin.php" method="post" name="login" target="_self" id="login" style="style.css" title="login"><br />
          <label>user    :          </label>
          <input type="text" name="username" id="username" />
          <label>password:          </label>
          <input type="text" name="password" id="password" />
          <input type="submit" name="Login" id="Login" value="Login" />
       </form>	
		
        
<div id="searchwrapper"><form action="search.php">
<input type="text" class="searchbox" name="s" value="Search" onFocus="if (this.value=='Search')this.value='';" onBlur="if (this.value=='')this.value='Search'" />
<input type="image" src="Images/submit2.jpg" class="searchbox_submit" value="" />
</form></div>


    </div>
urtrivedi 276 Nearly a Posting Virtuoso

remove SRC tag, HREF itself is enough.

<html>
<head> </head>

<body>
<a href ="what_the.html">go </a> 
</body>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

YOu should also tell what is the problem in displaying.

Whats happening and whats NOT happening.

urtrivedi 276 Nearly a Posting Virtuoso
$memque="select * from tblevent where member like '%5%' ";

OR

$filter="5";
$memque="select * from tblevent where member like '%{$filter}%' ";
urtrivedi 276 Nearly a Posting Virtuoso

you must exit after using header function

<?php
$name = $_POST['name'];
$bedrijfsnaam = $_POST['bedrijfsnaam'];
$adres = $_POST['adres'];
$plaats = $_POST['plaats'];
$postcode = $_POST['postcode'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$socialemedia = $_POST['socialemedia'];
$website = $_POST['website'];
$Type1 = $_POST['Type1'];
$type = $_POST['type'];
$productendiensten = $_POST['productendiensten'];
$productendiensten_anders = $_POST['productendiensten_anders'];
$vragen = $_POST['vragen'];
$formcontent=" Bevestiging van: $name, deze persoon is $Type1 \n Bedrijfsnaam: $bedrijfsnaam \n Adres: $adres $postcode $plaats \n Gebruiker van Sociale Media: $socialemedia \n Producten en Diensten: $productendiensten \n Anders: $productendiensten_anders \n Vragen en/off Opmerkingen: $vragen";
$recipient = "me@myemail.com";
$subject = "Contact";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
if (isset ($Type1['Burger']))
{
header("Location: burgerthanks.htm"); //the user will be sent to this page
exit;
}
if (isset ($Type1['Farm'])) {
header('Location: option2.htm');
exit;
} else
header('Location: thanks1.htm');
exit;
?>
urtrivedi 276 Nearly a Posting Virtuoso
ALTER TABLE tbl_oppourtunities ADD col1 varchar(20), add col2 varchar(25);
urtrivedi 276 Nearly a Posting Virtuoso

if 1 is cash, 2 is credit, 3 is cheque and so on
use following query

SELECT depositid, sum(if (paymenttypeid=1,amount,0)) cash,
sum(if (paymenttypeid=2,amount,0)) credit,
sum(if (paymenttypeid=3,amount,0)) cheque,
sum(if (paymenttypeid=4,amount,0)) anyother,
sum(amount) total 
FROM tbldepositpaymentdetails
GROUP BY depositid
ORDER BY depositid
urtrivedi 276 Nearly a Posting Virtuoso

for deposit id=1 all cash,cheque,credit with breakup

select depositid, paymenttypeid, sum(amount) total from tbldepositpaymentdetails
where depositid=1 
group by depositid, paymenttypeid
order by depositid, paymenttypeid

for deposit id=1 all total amount

select depositid, paymenttypeid, sum(amount) total from tbldepositpaymentdetails
where depositid=1 
group by depositid
order by depositid
urtrivedi 276 Nearly a Posting Virtuoso
select depositid, paymenttypeid, sum(amount) total from tbldepositpaymentdetails
group by depositid, paymenttypeid
order by depositid, paymenttypeid
urtrivedi 276 Nearly a Posting Virtuoso
Select sum(od.unitprice * od.quantity) as Amount,
ContactName  as customername  from [Order Details] as od
        inner join orders as o on o.orderid = od.orderid
        inner join customers as c on o.customerid = c.customerid
group by o.customerid,ContactName  
order by amount desc limit 1
urtrivedi 276 Nearly a Posting Virtuoso

what is ur sample data in tbldepositpaymentdetails, then also what u want as output
post sample input and sample output here

urtrivedi 276 Nearly a Posting Virtuoso

I think you have not visited the second link I have given.

http://databaseanswers.org/data_models/libraries_and_books/index.htm

This has complete ER diagram to start, you can build your own on this.

urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

SINGLE QUOTE IS INVALID AROUND DATEFIELD, its a column name not a text, so remove single quote surronding 'datefield'

$query="SELECT * FROM table DATE_FORMAT(datefield,'%d-%m-%Y')AS datefield FROM table";
urtrivedi 276 Nearly a Posting Virtuoso

any one know how to do in php

urtrivedi 276 Nearly a Posting Virtuoso

Anyway you have to use payment gateway. Direct account to account transfer integration is not possible.

CCAVENUE is good online payment service in india.
You need to pay it annual fees and may be one time setup fees


www.ccavenue.com

urtrivedi 276 Nearly a Posting Virtuoso

I could give you query, you find out asp.net syntax to connect it to database and fetch the total column value

select invoice_no, sum(dabit) total from table name where invoice_no=111
group by invoice_no
urtrivedi 276 Nearly a Posting Virtuoso

Best is to use paypal, they have api and manuals to integrate any web application with their payment gateway.

urtrivedi 276 Nearly a Posting Virtuoso

Kindly explain bit more what exactly you are looking for. because I am not able to understand your case.

Another little long way to do is
I suggest you one thing, If you have control over adding columns to seat master table.
You add one numeric order_no column.
so when you update or insert seat number say 1A, YOU UPDATE ORDER_NO with 165 by some logic, for eg. here I am converting A TO ascii value that is 65.

So whenever you want to sort, join transaction table with seat master table then order by column order_no

urtrivedi 276 Nearly a Posting Virtuoso

Following query may work as you want.

I have to tell you one thing that you should not use single quote and space in alias column name {'Mã số vật tư'} it should be as ma_so_vat_tru, without space and quote

SELECT detail.MatId AS 'Mã số vật tư', custom.CusMatName,

 
(
SUM(case when header.InvTransTypeId = 'IN1' and header.InvTransAccDate between '2011-01-01' and '2011-04-01' 

then Quantity else 0 end) -
SUM(case when header.InvTransTypeId = 'OU1' and header.InvTransAccDate between '2011-01-01' and '2011-04-01' 

then Quantity else 0 end)

)
-
(
SUM(case when header.InvTransTypeId = 'IN1' and header.InvTransAccDate between '2011-04-02' and '2011-08-01' 

then Quantity else 0 end) +
SUM(case when header.InvTransTypeId = 'OU1' and header.InvTransAccDate between '2011-04-02' and '2011-08-01' 

then Quantity else 0 end) 
)


 AS 'Total'

FROM InventoryTransDetail detail 
JOIN InventoryTransHeader header ON detail.InvTransHeaderId = header.InvTransHeaderId
JOIN Material material ON detail.MatId = material.MatId
JOIN CustomsMaterial custom ON material.CustMatId = custom.CustMatId
WHERE Header.InvTransAccDate BETWEEN '2011-01-01' AND '2011-08-01' 
GROUP BY detail.MatId, custom.CusMatName
urtrivedi 276 Nearly a Posting Virtuoso

The query is simple so it is not responsible for slow performance.
check your joins, also you can add as many table you want to join for that you need to add new columns in group by as well

GROUP BY detail.MatId, custom.CusMatName

Also do not remove date condition, it will filter result and will give result faster

urtrivedi 276 Nearly a Posting Virtuoso

to convert rows to column you need to do following query

select detail.MatId, 
SUM( case when header.InvTransTypeId = 'in1' then Quantity else 0 end) as IN1, 
SUM( case when header.InvTransTypeId = 'OU1' then Quantity else 0 end) as OU1,
SUM( case when header.InvTransTypeId = 'TK1' then Quantity else 0 end) as TK1,


SUM( case when header.InvTransTypeId = 'OU1' then Quantity else 0 end) 
-SUM( case when header.InvTransTypeId = 'IN1' then Quantity else 0 end) as OU_MINUS_IN,

SUM(QUANTITY) as TOTAL
from InventoryTransDetail detail join InventoryTransHeader header
ON detail.InvTransHeaderId =  header.InvTransHeaderId 
where  Header.InvTransAccDate between '2011-02-01' and '2011-03-01' GROUP BY detail.MatId
urtrivedi 276 Nearly a Posting Virtuoso

can u precisely tell what is ur requriment, means what you will input to php and what output is expected from it. Why mysql is not there in picture.

urtrivedi 276 Nearly a Posting Virtuoso

how to update class attribute in query is not known to me. some of line above to update class tag is not allowed in ie, that is to be comment out if browser is IE.

urtrivedi 276 Nearly a Posting Virtuoso

where ur starttime endtime stored?
In mysql or you want calculation in php

urtrivedi 276 Nearly a Posting Virtuoso

This is what you are looking for, But right now its not working in IE, u may try on other browser and then later you can build your logic more using this code.

<html>
<head>
<style  type="text/css">

.answerBtnsOff

{

	BACKGROUND-COLOR: #ffffff;

	BORDER-BOTTOM: #666666 1px solid;

	BORDER-LEFT: #666666 1px solid;

	BORDER-RIGHT: #666666 1px solid;

	BORDER-TOP: #666666 1px solid;	

	COLOR: #c;

	FONT: 11px Verdana,Arial,Helvetica,sans-serif;

	font-weight:bold;

}

.answerBtnsOn

{

	BACKGROUND-COLOR: GREEN;

	BORDER-BOTTOM: #666666 1px solid;

	BORDER-LEFT: #666666 1px solid;

	BORDER-RIGHT: #666666 1px solid;

	BORDER-TOP: #666666 1px solid;	

	COLOR: #ffffff;

	FONT: 11px Verdana,Arial,Helvetica,sans-serif;

	font-weight:bold;

}

</style>

<script lang=javascript>
var currenttotal=0;
function getButtons()
{
	document.getElementById("answerA").class="answerBtnsOff";
	document.getElementById("answerA").setAttribute("class","answerBtnsOff");
	document.getElementById("answerA").setAttribute("className","answerBtnsOff");

	document.getElementById("answerB").class="answerBtnsOff";
	document.getElementById("answerB").setAttribute("class","answerBtnsOff");
	document.getElementById("answerB").setAttribute("className","answerBtnsOff");

	document.getElementById("answerC").class="answerBtnsOff";
	document.getElementById("answerC").setAttribute("class","answerBtnsOff");
	document.getElementById("answerC").setAttribute("className","answerBtnsOff");

	document.getElementById("answerD").class="answerBtnsOff";
	document.getElementById("answerD").setAttribute("class","answerBtnsOff");
	document.getElementById("answerD").setAttribute("className","answerBtnsOff");

	document.getElementById("answerE").class="answerBtnsOff";
	document.getElementById("answerE").setAttribute("class","answerBtnsOff");
	document.getElementById("answerE").setAttribute("className","answerBtnsOff");
			
	currenttotal=0;
}
function btnclick(btn)
{
 	if(document.getElementById("numberDropId").value=="")
 	{
	 	alert('Select option');
	 	return false;
	}
	if (btn.class=="answerBtnsOn")
	{
		btn.class="answerBtnsOff";
		btn.setAttribute("class","answerBtnsOff");
		btn.setAttribute("className","answerBtnsOff");

		currenttotal--;
		return false;
	}
 	if(document.getElementById("numberDropId").value==currenttotal)
 	{
 	 	alert('Not allowed beyond limit, deselect other button');
 		return false;
 	}
	if (btn.class=="answerBtnsOff")
	{
		btn.class="answerBtnsOn";
		btn.setAttribute("class","answerBtnsOn");
		btn.setAttribute("className","answerBtnsOn");
		currenttotal++;
		return false;
	}
	
}
</script>
</head>
<body>
<p>
    <select name="numberDropId" id="numberDropId" onchange="getButtons()" >
    <option value=""></option>
    <option value="1">1</option>
    <option value="2">2</option>
    <option value="3">3</option>
    <option value="4">4</option>
    </select>
    </p>

    <p>
    <input class="answerBtnsOff" name="answerA" id="answerA" type="button" value="A"  onclick='javascript:btnclick(this);' />
    <input class="answerBtnsOff" name="answerB" id="answerB"  type="button" value="B"  onclick='javascript:btnclick(this);'  />
    <input class="answerBtnsOff" name="answerC" id="answerC"  type="button" value="C"   onclick='javascript:btnclick(this);' />
    <input class="answerBtnsOff" name="answerD" id="answerD"  type="button" value="D"   onclick='javascript:btnclick(this);' />
    <input class="answerBtnsOff" name="answerE" id="answerE"  type="button" value="E"   onclick='javascript:btnclick(this);' />
    </p>
    </body>
    </html>
urtrivedi 276 Nearly a Posting Virtuoso

You are appending elements to same TD,
instead I would suggest you to add TR TD FOR EACH ROW

urtrivedi 276 Nearly a Posting Virtuoso

this is more precise to your case

insert into TABLENAME (col1, col2,  NAME,lcno) 
select '{$_POST['col1']}' , '{$_POST['col2']}', '{$_POST['name_relation']}', lcno FROM family_details WHERE name='{$_POST['name_relation']}'
urtrivedi 276 Nearly a Posting Virtuoso

why you want to add one more field, One thing I feel is that your database is not normalized.

Now if this it is mandatory requirement, then you can do one thing
you must be having action page to insert or update mysql data, while inserting query you join from the table where there is lcno and name

insert into TABLENAME (col1, col2, LCNO, NAME) 
select '{$_POST['col1']}' , '{$_POST['col2']}', '{$_POST['code']}', NAME FROM MASTERTABLE WHERE LCNO='{$_POST['code']}'

Here i assume {$_POST} is dropdown name and master table is table from where you populate dropdown

urtrivedi 276 Nearly a Posting Virtuoso

1) open formularz.php in line number 2 set action to jak_kupic.php

<form action="jak_kupic.php" method="post" id="form1">

save formularz.php and upload on server


2) DO NOT open jak_kupic.html. now open
www.hogar-biokominki.pl/formularz.php

urtrivedi 276 Nearly a Posting Virtuoso

category was just example you need to set what ever number of columns you want
only important is index of row which is clicked

urtrivedi 276 Nearly a Posting Virtuoso

change

$index=$_POST;
echo $_SESSION[[B]$index[/B]];

urtrivedi 276 Nearly a Posting Virtuoso

you should keep an index or row number

$i=0;
while($row = mysql_fetch_array($result)){
echo "<form>";
$_SESSION[$i]['category'] = $predictrow['category'];
echo "<input type=hidden name=clickindex id=clickindex value={$i}>";
$i++;
echo "</form>";
}

now in your action page(predictproc.php) you can use clickindex variable

<?php
$index=$_POST['clickindex];
echo $_SESSION[]['category'];
?>
urtrivedi 276 Nearly a Posting Virtuoso

In the beginning of your code write following two lines, it will show ur exact error.

error_reporting(E_ALL); 
	ini_set("display_errors", 1);
urtrivedi 276 Nearly a Posting Virtuoso

1)
You must use {} around varaibles in string when it has quote or array

$images_dir = "images/{$mysql_array['id']}/";
$thumbs_dir = "images/{$mysql_array['id']}/thumbnails/";

2)
also your while loop is with out braces and code.

Specify you want to read data from mysql or you want to read directory.

urtrivedi 276 Nearly a Posting Virtuoso

what you have done so far? post your code, and tell whats NOT happening.

urtrivedi 276 Nearly a Posting Virtuoso

its works both way, ip wise and computer name wise or domain name wise.

like
http://72.30.2.43 is current ip of yahoo.com, so you can open site using both ip and name.