urtrivedi 276 Nearly a Posting Virtuoso

Following code may help you

<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 contains only those values which are selected and stored in database
	$myselarray[0]['id']='pkvalue'

*/
$elementstring ="\n<SELECT id='listbox'  size=10 name='listbox' multiple>";			
for ($i=0;$i<count($mywholearray);$i++)
{

	 $seltext="";
	 for($j=0;$j<count($myselarray);$j++)
	 {
	    if ($mywholearray[$i]['id']==$myselarray[$j])
                   {
		  	$seltext=" selected ";
		break;	
                     } 
	 }

	 $elementstring .= "\n";
     $elementstring .=  "<OPTION value='{$mywholearray[$i]['id']}' {$seltext}>";
     $elementstring .="{$mywholearray[$i]['desc']}</OPTION>";
}

$elementstring .="\n</SELECT>";
echo $elementstring;
	     
?>

</form>
</body>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

Its perfect.

urtrivedi 276 Nearly a Posting Virtuoso
select team ,sum(points) from 

(

select hometeam team, sum(homepoints) points
from fixtures
group by hometeam
union
select awayteam team, sum(awaypoints) points
from fixtures
group by awayteam

)
group by team
urtrivedi 276 Nearly a Posting Virtuoso

There is no straight forward way of entereing multiple table entry in one single page. It requires lot of javascript and php coding to achive such thing.
For photograph, You can keep one photo_filename column in family table. where you should allow user to upload photo file. and save its name in the above column.
You should go two separate pages one for family and another for member.

urtrivedi 276 Nearly a Posting Virtuoso

Writing or explaining whole code will be difficult, better you search some php form tutorial and If you find any problem you may post that particular problem here.

urtrivedi 276 Nearly a Posting Virtuoso

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) same code you may write for previous. just fin max instead of min.
6) following code may have syntax error, correct the code whereever applicable

protected void NextQuestionButton_Click(object sender, EventArgs e)
{
  SqlConnection con = new SqlConnection(scon);
        con.Open();
        
''find next number 
		nextnumber =  new SqlCommand("select min(questionid) from Questions where questionid>" & currequesID, con);
		
        cmd = new SqlCommand("select Question from Questions where questionid =" & nextnumber, con);
        readqus = cmd.ExecuteReader();
			        
        while (readqus.Read())
        {
            
           QuestionLabel.Text = readqus[0].ToString();
           	exit;
            }
             readqus.Close();
        con.Close();
        
        currquesid=nextnumber;
}
urtrivedi 276 Nearly a Posting Virtuoso

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 can take backup using mysql command on your database server which will take backup of your database in sql file or any format you prefer.
2) Set default folder for db backup file.
3) you may schedule this command to execute daily.

4) Now through ftp you may download that file everyday from another server or pc

5) You may also write ftp access code using .net to download that file from database server to you another server/pc.

urtrivedi 276 Nearly a Posting Virtuoso

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

urtrivedi 276 Nearly a Posting Virtuoso
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, 1, 1)-1 period FROM  CC  JOIN teachers ON teachers.id = cc.teacherid WHERE (cc.course_number >= 24501 AND cc.course_number <= 24521)AND cc.dateleft = '			24-JUN-10'
						) CC2 ON students.id = cc2.students
						
WHERE students.schoolid=47
urtrivedi 276 Nearly a Posting Virtuoso

Inner join customer_2 on customer.cust_num=customer_2.cust_num

urtrivedi 276 Nearly a Posting Virtuoso

I have modified line 24 to 27 of your code. I have used substr function.

<html>
<?
$con=mysql_connect("localhost","root","root");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db('test',$con);
//(1) Read the text file into a variable
$file=fopen("ATND.txt","r") or exit("Unable to open file!");
//(2) Then we can get rid of the tabs in there:
$output = str_replace("\t"," ", $file);
//(3) Then we explode it at every line break
$output = explode("\n", $output);
//(4) Then we loop through all the array elements and explode them again and insert them into mysql
foreach($output as $var)
{
$tmp = explode(" ", $var);
//$ecode = $tmp[0];
$ecardno = $tmp[0];
$atdate = substr($tmp[1],0,6);
$attime = substr($tmp[1],6,4);
$IO = substr($tmp[1],10,1);
$scode = substr($tmp[1],11,7);
$sql = "INSERT INTO att SET ecardno='$ecardno',atdate='$atdate',attime='$attime',IO='$IO',serialno='$serialno'";
mysql_query($sql);
}
echo "Done!";
mysql_close($con);
?>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

You can set dynamic javascript code using php variable using following code.

<script lang='javascript'>
 window.location='page<?php echo $var?>.php';
</script>
urtrivedi 276 Nearly a Posting Virtuoso

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 (col1,col2) values('$col1','$col2');

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

Have you tried the solution provided by almostbob.
You need to take out javascript code from css tags and wrap it in script tags.

<script type='text/javascript'>
function changeImage(obj)
{
         obj.src ="creek.jpg"; 
         obj.src = "dock.jpg"; 
}
</script>
urtrivedi 276 Nearly a Posting Virtuoso

use quotes around

function changeImage(obj)
{
obj.src ="creek.jpg"; 
obj.src = "dock.jpg"; 
}

creek will be ignored and dock will be displayed. why you are doing so?

urtrivedi 276 Nearly a Posting Virtuoso

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.

update table  mytable
set 
category=substr(substring_index(data,'>',-5),1,instr(substring_index(data,'>',-5),';')-1),
nav=substr(substring_index(data,'>',-4),1,instr(substring_index(data,'>',-4),';')-1),
rprice=substr(substring_index(data,'>',-3),1,instr(substring_index(data,'>',-3),';')-1),
sprice=substr(substring_index(data,'>',-2),1,instr(substring_index(data,'>',-2),';')-1),
date=substr(substring_index(data,'>',-1),1,instr(substring_index(data,'>',-1),';')-1)
urtrivedi 276 Nearly a Posting Virtuoso

You use my code, It is correct version.
You simply remove form1.focus(); line from your function. You can not focus on any form.

urtrivedi 276 Nearly a Posting Virtuoso

try following code in your validation function

else if(form1.date5.value=='0000-00-00')	
{
alert('Select the Start Date');		
form1.focus();		
return false;	
}
urtrivedi 276 Nearly a Posting Virtuoso

there is problem in line 28
$postPassword = $_POST["postPassword"];

change it to
$postPassword = $_POST["postPass"];

urtrivedi 276 Nearly a Posting Virtuoso

following code will return age in days for each user

SELECT username,datediff( current_date( ) , birthdate ) 
FROM datatable
urtrivedi 276 Nearly a Posting Virtuoso

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.

...
.
.

</body>
</html>
<?php
if($isSubmitted == "yes") {	if($postUser == "admin" && $postPassword == "pass") {		corrLogin();		}	else {		incorrLogin();		}	}
?>
urtrivedi 276 Nearly a Posting Virtuoso

borrow table is transcation table and it contains user id and book id. so user is related to book in borrow table. User is not directly connected with book.

Now what do you mean by reversation?

urtrivedi 276 Nearly a Posting Virtuoso

That sentence is copied from php manual

urtrivedi 276 Nearly a Posting Virtuoso

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.

urtrivedi 276 Nearly a Posting Virtuoso

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

urtrivedi 276 Nearly a Posting Virtuoso

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

//determine id
//$id=SELECT max(substr(rollno,2))+1 FROM `alumni_job`;

$id='c'.$id;

insert into table (comp_id,name) values ('$id','$name');
urtrivedi 276 Nearly a Posting Virtuoso

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 into agent_users table
5) save id in $user_id variable using mysql_insert_id($link)
6) now insert into agent_comapany table like

"insert into agent_company (agent_id,exp_age_yr, exp_age_month.........)
values ('$user_id}',$data[exp_age_yr]', '$data[exp_age_mo]',)";

NOW AGENT_ID COLUMN IN BOTH TABLES IS A LINK BETWEEN TWO TABLES.

urtrivedi 276 Nearly a Posting Virtuoso

1) Your move_uploaded_file() need semicolon at the end
2) your last else( for invalid file message) is without if

<?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 />";
// echo "Type: " . $_FILES["file"]["type"] . "<br />";
// echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
// echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";


if (file_exists( "upload/" . @$_FILES["file"]["name"]))

{
echo $_FILES["file"]["name"] . " already exists. ";
echo "</br>link:<a href='upload/$basename'>$basename</a>"; 
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],"upload/" . $_FILES["file"]["name"])

type semicolon here

echo 'upload/' . $_FILES["file"]["name"];
//echo "<a href='upload/$basename'>$basename</a>";
echo "Stored in: ".realpath('upload/'. $_FILES["file"]["name"]);
//echo "</br>link:<a href=http://localhost/stored1/upload/>$name</a>";
//echo "</br> linkinfo:" .linkinfo('upload/'. $_FILES["file"]["name"]);
//echo "</br> <a href='upload/$basename'>$basename</a>";
echo " </br>Upload Sucessfull";
}

}

following else is witout if

else
{
echo "Invalid file";
}
[/b]
//echo "<a href='upload/$basename'>$basename</a>";

?>




<html>
<body>
<form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<label for="file">Filename:</label>
<input type="file" name="file" id="file" /> 
<br />
<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
urtrivedi 276 Nearly a Posting Virtuoso
<input name='answer[]' type='text'>";

use above html code then you will get arrary of answer text box in php when form is submited

urtrivedi 276 Nearly a Posting Virtuoso

try

$filter = $_REQUEST['att'];
urtrivedi 276 Nearly a Posting Virtuoso

Then you may use code in post no #6 of this thread.

urtrivedi 276 Nearly a Posting Virtuoso

I dont think keeping one table per cell in database is a right approach.

urtrivedi 276 Nearly a Posting Virtuoso

In your php code Before inserting or updating. use follwoing code

insertquery="insert into mytable (col1,col2,date1) 
values('val1','val2',
date_format(".$_POST['htmldatefieldname']."'%Y-%m-%d') )"
urtrivedi 276 Nearly a Posting Virtuoso

select * from lease_tablen
while loop{}

If you have one table per cell, then this design is very poor.?
Even though you may execute query using two for loops

$rows=find number of year rows for particular user;
$cols=8; //year,due date, date sent etc
for ($rowindex=1;$rowindex<=$rows;$rowindex++)
{
 	print "<tr>";
	for ($colindex=1;$colindex<=$cols;$colindex++) 
	{
		$queryresult="select * from table".$rowindex*$colindex;// this will give appropriate table name for your cell
		//execute above query here
		print "<td>{$result}</td>";
	}
	print "</tr>";
}

above code is not syntatically correct.

urtrivedi 276 Nearly a Posting Virtuoso

Are you confused with report query or data structure?

urtrivedi 276 Nearly a Posting Virtuoso

Following code may help you. I am assuming that your ch value is number.

<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>";
	echo "</table>";
	echo "<input type=hidden value='' name=chvalue id=chvalue>";
	echo "</form>";
</html>
urtrivedi 276 Nearly a Posting Virtuoso

Your query seems to be ok, though I have changed last line. Let me know what result /error are you getting.

$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 product_styles AS s ON s.id = i.product_style_id 
GROUP BY [b]s.name [/b]";
urtrivedi 276 Nearly a Posting Virtuoso

You may use javascript in your mail code but its exeution will depend on browser/email client setting. It may prompt/warn user to execute javascript.

Better option
1) create simple html form. give submit button without validation send it as mail.
2) user fills form in his email and submits.
3) action page will be on your website. validate fields on action page.
4) if user doesnt fill form properly then redirect it to similar form page(with validation code) as sent in email. if user enter everything properly then insert in your database.

urtrivedi 276 Nearly a Posting Virtuoso

Your html code will work well but, javascript code may be blocked by mail client. So it will not work as per you expectations.

urtrivedi 276 Nearly a Posting Virtuoso

Does filemaker pro comes with standard mac or we need to install it separtely?

urtrivedi 276 Nearly a Posting Virtuoso

add my lines of code before $topicsBody = "";

urtrivedi 276 Nearly a Posting Virtuoso

I am modifying line 10 to 12.

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

You have not passed conection parameter. change you code as given below.

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

I guess you want to show some message or tool tip when someone moves mouse over your image. add highligted text in your 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>
urtrivedi 276 Nearly a Posting Virtuoso

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?

urtrivedi 276 Nearly a Posting Virtuoso

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

urtrivedi 276 Nearly a Posting Virtuoso

rename srno to orderno

urtrivedi 276 Nearly a Posting Virtuoso

You mean to say srno column

urtrivedi 276 Nearly a Posting Virtuoso

I hope you have initialised the three variable. select all four sql statments and execute in phpmyadmin