<?php
require "../conn.php";
$con = getConn();
if ($con){
mysql_select_db($db);
$sql=mysql_query("Select Max(refno) as num from Payment_infor");
$row = mysql_fetch_row($sql);
$newNum =$row['num']+1;
mysql_query("INSERT INTO Payment_infor (refno)
VALUES ('$newNum')");
}
?>
i want to select max order and increament by 1
Moderator: General Moderators
Re: i want to select max order and increament by 1
[sql] INSERT INTO Payment_infor (refno) SELECT MAX(refno) + 1 FROM Payment_infor [/sql]
There are 10 types of people in this world, those who understand binary and those who don't