urtrivedi 276 Nearly a Posting Virtuoso

add second and third line shown below at line number 14

show_user_info($username);
$conn=mysql_connect("localhost","username","password");
mysql_select_db("dbname",$conn);

$q1="select timestamp from users where username='$username'";
$r1=mysql_query($q1);
urtrivedi 276 Nearly a Posting Virtuoso
$result = mysql_query( "SELECT page_name FROM ms_content" )
	or die(mysql_error()); 
$num_rows = mysql_num_rows($result);
$mainmenu="";
while ($get_info = mysql_fetch_row($result))
{	
        $mainmenu .= ".:";	
        $mainmenu .= $get_info[0];
        $mainmenu .= "</br>";
}
urtrivedi 276 Nearly a Posting Virtuoso

while inserting you can do like

INSERT INTO `data` (`test`, `test1`, `test2`, `total`) VALUES(20, 20, 20, 20+20+20);

after inserting you must run update query like

update data set total=test+test1+test2 where total=0
urtrivedi 276 Nearly a Posting Virtuoso

post your code here

urtrivedi 276 Nearly a Posting Virtuoso

add one more closing ) before { at line 41

if(!empty($_POST['pass1']) ) {
urtrivedi 276 Nearly a Posting Virtuoso

I think when you connect in java, you must always run this two query before doing anything, because change is applicable to session only. TO CHANGE IT PERMANANTELY YOU MUST HAVE SYSTEM USER ACCSESS

urtrivedi 276 Nearly a Posting Virtuoso

before executing query you echo it for example. copy that query result from browser and run in phpmyadmin, is it running there

$query="update ir312 SET R3_21 = $tot WHERE irdnumber=$irdnumber ";
echo $query;
mysql_query($query)

several reason for query failure.
1) On linux mysql table name are case sensitive
2) have you selected proper database before executing query

urtrivedi 276 Nearly a Posting Virtuoso

at the end of page load write following js code

<script lang='javascript'>
checkCheckBoxes();
</script>
urtrivedi 276 Nearly a Posting Virtuoso

post complete code, and let me know when logic fails (what you input and what not)

urtrivedi 276 Nearly a Posting Virtuoso

function is running fine here

I think you have problem with

<input type="checkbox" name="chk1"  onclick='checkCheckBoxes()' />check for Birth year only

or if you have chrome, then open tool> java script console, there you will able to see error.

urtrivedi 276 Nearly a Posting Virtuoso

I am not sure about the command, but you may have noticed this line in that link

Your client tool may be overriding your carefully set NLS Parameters. For example, in SQL Developer and JDeveloper (Tools -> Preferences… -> Database -> NLS Parameters)

Check the database parameters:

select * from nls_session_parameters;

This could also help

ALTER session SET NLS_COMP=LINGUISTIC 
ALTER session SET NLS_SORT=BINARY_AI
urtrivedi 276 Nearly a Posting Virtuoso

How mysql server will know what to select out of multiple choices,
1134
1125

What is criteria of selection. what is the version of mssql

urtrivedi 276 Nearly a Posting Virtuoso

I used to convert things in upper case while comparing strings in oracle

select * from test where upper(ID_PRIVILEGES) = upper('Admin');

You may also follow this link
http://geekzspot.blogspot.com/2010/01/case-insensitive-oracle-database.html

urtrivedi 276 Nearly a Posting Virtuoso

where is checkcode() source code? Post complete code and what exact problem your facing?

How would somebody know, that what is not working in your case?

urtrivedi 276 Nearly a Posting Virtuoso

make only two changes as shown below

<?php
.
.
.
.
while ($row = mysql_fetch_assoc($extract) || $totala<10)
{

$totala++;
.
.
.
.

?>
urtrivedi 276 Nearly a Posting Virtuoso

you may try

wardrobe.php?key=hash&value=HASHTAG
or
wardrobe.php?key=friend&value=FRIENDNAME

your code file may look like

<?

header("Content-Type: image/png");

$value = strtolower($_GET['value']);

if( strtolower($_GET['value'])=='hash')
   $filepath = "wardrobe/$value";

else if( strtolower($_GET['value'])=='friend')
   $filepath = "wardrobe/md5($value)";
else
   exit;

$errorpath = "wardrobe/cb5e100e5a9a3e7f6d1fd97512215282";

if (is_readable($filepath)) {
	readfile($filepath);
} else {
	readfile($errorpath);
}	




?>
urtrivedi 276 Nearly a Posting Virtuoso
<html>
<head>
<script lang='javascript'>
var isNumeric  = /^(\d*)(\.?)(\d*)$/;

function checknum()
{
     if (!isNumeric.test(document.frm.txt1.value))
     {
	 alert( 'Not a valid number');
	 return false;
     }
     else
     {
        alert( 'Number Accepted');
	return false;
     }
}
</script>
</head>
<body>
<form name=frm id=frm action='#' method=post>
<input type=text name=txt1 id=txt1>
<input type=button name=btn1 id=btn1 value=check onclick='javascript:checknum()'>
</form>
</body>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

In your b.asp code you may write

<%
dim txt1
txt1=Request.Form("txt1")
If txt1<>"" Then
      Response.Write("txt1=" & txt1)
End If
If Request.Form("txt1")<>"" Then
      Response.Write("txt2=" & Request.Form("txt1"))
End If

If Request.Form("myfield")<>"" Then
      Response.Write("myfield=" & Request.Form("myfield"))
End If
%>
urtrivedi 276 Nearly a Posting Virtuoso

In page a.asp you can keep one hidden form element, that will be passed to b.asp on submitting form. IN setvalue fuction you can set value for that field before submitting the form.

<script lang='javascript'>
function setvalue()
{
     document.getElementById('myfield ').value='newvalue';
     document.frm.submit();
}
</script>
<form name=frm action=b.asp method=post>
<input type=text name=txt1>
<input type=text name=txt2>
<input type=hidden name=myfield id=myfield value='somevalue'>
<input type=button name=txt1 onclick='javascript:setvalue()'>
</form>
urtrivedi 276 Nearly a Posting Virtuoso

1) also keep address part in deleiver and order, because all customers are not regular customer, may want delivery at another address

2 ) you may keep amount column in deliver(qty*price)
3) as discussed in previous posts, you may add order_id_reference in delelivery_note

urtrivedi 276 Nearly a Posting Virtuoso

If you are doing for class project than its fine. You do not need to show order_id_reference. It may be used to track orders if required.

But in real case one delivery may consists of many orders. So in that case you will need order, delivery relation table, that is one delivery many orders.

You should keep total column, and store calculated values in it, it means we are showing in report what ever stored in database. Always avoid calculations in reports (this is my personal opinion).

urtrivedi 276 Nearly a Posting Virtuoso

I think keep structure of delievery as it is. You may add one column in delivery that is order_id_reference. while creating delivery note you can show list of order and could be selected, which will copy all details of customerid, address and all that. You may also bring items and ordered quantity.

Here user may add/edit/modify details (delivery may not look same as order)

urtrivedi 276 Nearly a Posting Virtuoso

Login to phpmyadmin (with working login info). Server:localhost, privileges. add user and host. Do this carefully.

urtrivedi 276 Nearly a Posting Virtuoso

if you have php myadmin, select your table, click export ->go, it will give you table mysql script, paste it here

I think you have not seen my post properly, its no only -21, I have interchanged the columns
see carefully

and add_date < DATE_ADD(current_date, INTERVAL -21 DAY)
urtrivedi 276 Nearly a Posting Virtuoso

can u post mysql table script with data

urtrivedi 276 Nearly a Posting Virtuoso

I think you should get the result in some php variable.

or I think follwing link may help you

http://devzone.zend.com/node/view/id/651

urtrivedi 276 Nearly a Posting Virtuoso

It is good to develop tools for generating forms. It is essential for self growth. But those who do not have time to do all this, they should use ready to use tools. For managing mysql table data operation, I use free version of php datagrid428 (support is stopped for free version). It is still left with so many bugs, They have removed bugs in latest version, but latest version is not a free one.

urtrivedi 276 Nearly a Posting Virtuoso
and add_date < DATE_ADD(current_date, INTERVAL -21 DAY)
urtrivedi 276 Nearly a Posting Virtuoso

submit your query, and mysql table script with data

urtrivedi 276 Nearly a Posting Virtuoso

no such facility is there in html.
You may user jquery-ui, datepicker, its easy to use

urtrivedi 276 Nearly a Posting Virtuoso

Submit date is name for your date column which you want to check for 21 days.
(you must change it ). Here function is date_add and not submit_date.

urtrivedi 276 Nearly a Posting Virtuoso

I think you do not need php , you can simply do it in mysql query itself

SELECT * from table_name 
where date_add(submit_date ,interval 21 day ) <= current_date
urtrivedi 276 Nearly a Posting Virtuoso

Here you can see I have executed query only once, and shortened for loop.

$operator="";
$condition="";
for( $i = 0; $i < count($words); ++$i ){
	$condition.=$operator." CONCAT(FirstName, ' ',LastName) LIKE  CONVERT(_utf8 '%".$words[$i]."%' USING latin1) COLLATE latin1_swedish_ci";
	$operator=" OR ";
}
$sql = "SELECT *,CONCAT(FirstName, ' ',LastName) as fullname FROM `ajax_demo_table`   ";

if ($condition!="")
$sql .= " where ($condition) ";
urtrivedi 276 Nearly a Posting Virtuoso

Even if you use another process reg page you can still send the entered data back to main form in case of error.

If you want to send data to same form, you may use cookies to overcome resend issues.

Ajax can work in any way, one page or two page.

I personally feel one page coding is always little complicated (either for processing or for ajax).

So go for separate process handler.

urtrivedi 276 Nearly a Posting Virtuoso

you may use session variable but take care naming variable, name them accoring to page name.
I think its better to store paging, searching info in clients computer using cookies, rather than using session variable.

urtrivedi 276 Nearly a Posting Virtuoso

Before using datagrid428, when I was paging myself. I used to use cookie to store search criteria and page numbers.

urtrivedi 276 Nearly a Posting Virtuoso

DO you know about php datagrid428 (its free). YOu can create forms where you can add/edit/delete/print/export with ease and paging option. Also you can connect php with any database well known.

I would recommend to not waste time in writing code. go for it.

Warning: free version is with some bugs and they have stopped supporting users of free version. But basic functionality still works.

urtrivedi 276 Nearly a Posting Virtuoso
$chkdt = "Wed Jun 15 2011 00:00:00 GMT 0530 (India Standard Time)";
$chkdtarr=explode("GMT",$chkdt);
$newdt= strtotime($chkdtarr[0]);
echo $newdt;
echo "<br>".date("m/d/Y",$newdt);
urtrivedi 276 Nearly a Posting Virtuoso

generally we use term FLAG for boolean kind of variable. FLAG is not a part of any programming language. Its just something to understand things in better manner.

Here I have used boolean variable or flag named $FOUND. Before starting loop I set it to false. If it goes in loop I set it to true, means that at least one record found. If query cause no record, the flag will remain false and it will print that message.

You may also use mysql_num_rows(), if you do not want to use flag

I am not sure your problem is solved or not, if yes then mark it solved.

masterjiraya commented: thnaks this thread has been solved +3
urtrivedi 276 Nearly a Posting Virtuoso

post structure of ex_cat, and ex_tax
or try with ` around word group, because group is reserved word

$sql="INSERT INTO ex_cat (username,exp_id,used_category,`group`,type)
SELECT ex_tax.username,ex_tax.exp_id,ex_tax.category,ex_tax.`group`,ex_tax.type
FROM ex_tax WHERE ex_tax.username='$uname' AND ex_tax.exp_id='$exp_id' AND ex_tax.used='1'";
urtrivedi 276 Nearly a Posting Virtuoso

I have separated table, and now using one found flag.

<?php 		



$q=$_GET['q'];
$words=explode(' ',$q);
$con = mysql_connect('localhost', 'root', 'jaishal1110')or  die('Could not connect: ' . mysql_error());

mysql_select_db("test", $con)or die('cannot connect');

//$sql = 'SELECT * FROM `ajax_demo_table`  WHERE `FirstName` LIKE CONVERT(_utf8 \'%'.$q.'%\' USING latin1) COLLATE latin1_swedish_ci OR `LastName` LIKE CONVERT(_utf8 \'%'.$q.'%\' USING latin1) COLLATE latin1_swedish_ci'; 
$q = preg_replace('/\s\s+/', ' ', $q); // remove extra space
for( $i = 0; $i < count($words); ++$i ){
$sql = "SELECT *,CONCAT(FirstName, ' ',LastName) as fullname FROM `ajax_demo_table` WHERE CONCAT(FirstName, ' ',LastName) LIKE  CONVERT(_utf8 '%".$words[$i]."%' USING latin1) COLLATE latin1_swedish_ci ";
//echo $sql;

$result = mysql_query($sql) or die('cannot query '.$result);
echo "<table border='1'>";

//if(mysql_fetch_array($result)>=1){
echo"
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Age</th>
<th>Hometown</th>
<th>Job</th>
</tr>";
$found=false;
while($row = mysql_fetch_array($result))
  {
$found=true;
  echo "<tr>";
  echo "<td>" . $row['FirstName'] . "</td>";
  echo "<td>" . $row['LastName'] . "</td>";
  echo "<td>" . $row['Age'] . "</td>";
  echo "<td>" . $row['Hometown'] . "</td>";
  echo "<td>" . $row['Job'] . "</td>";
  echo "</tr>";
//  echo "<tr><td colspan=5><hr></font></td></tr>";
  }if(!$found){
echo "<tr><td><b>NO<b> similar names with <font color=red><b>".$words[$i].'</b></font></td></tr>';

}
echo "</table><hr>";


}

//end of while
//}

//}
//echo "</table><hr>";
mysql_close($con);

?>
urtrivedi 276 Nearly a Posting Virtuoso

Then you script is working fine. Now I am not able to understand what more you are expecting from it.

urtrivedi 276 Nearly a Posting Virtuoso

I think problem is due to onkeyup event, it is constantly changing query.

<input type="text" name="users" onkeyup="showUser(this.value)">

change onkeyup to onblur

<input type="text" name="users" onblur="showUser(this.value)">
urtrivedi 276 Nearly a Posting Virtuoso

upload sql script with definition and data of ajax_demo_table

urtrivedi 276 Nearly a Posting Virtuoso
<?php 		
$arr1 = array('1','2','3','4','5','6','7','158','12');
$arr2 = array('2','5','4','8','12','6','7','154','124','131');

echo "<pre>";

$insert =array_diff($arr2,$arr1);
$update =array_intersect($arr2,$arr1);
//print_r($update);

foreach($update as $key)
{
	echo $key." update <br>";
}
echo "<br><br>";
foreach($insert as $key)
{
	echo $key." insert<br>";
}
echo "</pre>";
?>
urtrivedi 276 Nearly a Posting Virtuoso

YOU can remove it and make it to

$where="";

urtrivedi 276 Nearly a Posting Virtuoso
if(isset($_GET['advance_searching']) && !empty($_GET))
{

$where = " 1 = 1 ";
if($_POST['search_remarks']!="")	{
$s[] = "`remarks` like '%"	. mysql_real_escape_string($_POST['search_remarks']) . "%'";
}

if($_POST['search_industry']!="")	{
$s[] = "`industry` like '%"	. mysql_real_escape_string($_POST['search_industry']) . "%'";
}

if($_POST['search_position']!="")	{
$s[] = "`position` like '%"	. mysql_real_escape_string($_POST['search_position']) . "%'";
}

if($_POST['search_location']!="")	{
$s[] = "`location` like '%"	. mysql_real_escape_string($_POST['search_location']) . "%'";
}

if($_POST['age_one']!="" && $_POST['age_two']!="")	{
	$s[] = "(`age` between "	. intval($_POST['age_one']) ." AND ".intval($_POST['age_two']) .")";
}

if(isset($s)){
$where = "WHERE (" . implode(" AND ",$s).")";

}


}

$query_str = "SELECT * FROM resumevault {$where}";
echo $query_str;
urtrivedi 276 Nearly a Posting Virtuoso

When You are looking in four search fields in same column (PROCESS), then AND will not work. You need to implode with OR. Same is applicable to AGE field. Separate age1, age2 with OR

Another thing I would like to mention there is no need to keep 4 fields. you can keep one field for one column, ultimately you are using PROCESS and AGE column so you need only 2 search fields not 6.

urtrivedi 276 Nearly a Posting Virtuoso

Actually there is no difference, Its my own feeling, I prefer print_r. Otherwise most important part is using pre for displaying values in proper format.

urtrivedi 276 Nearly a Posting Virtuoso

Better way to view your array is following, after setting your array, write following 3 lines at the end of your code.

echo "<pre>";
print_r($_SESSION['cart']);
echo "</pre>";