Jump to content

MAX value not showing in query


nitesh

Recommended Posts

Hi everybody iam trying to insert the last MAX value plus 1 value for example if my last value in database is 6 then it will insert 7 if 8 then 9 below is my code(Iam using MAX function)when i echo value before using in INSERT query (with SELECT statement) it's working fine but when i use $arrData variable in INSERT query it's showing blank value pls help.BELOW is my code $query = "SELECT MAX(position) + 1 AS 'position' FROM pages"; $rsQuery = dbQuery($query); $arrData = dbFetchRow($rsQuery); echo $arrData[0]; $qryInsert = "INSERT INTO pages (PageHeading,PageName,Content,position,Status) VALUES ('$pName','$pHeading','$pContent',$arrData,'$status')"; $rsQuery = dbQuery($qryInsert);

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...