0

Actually I am creating database on wamp server with the help of php. There is some calculation among some fields.This database for is for lab procurement in which every entry is for new file.Every thing is done but the problem is come when I try to insert a new values for a new file but one value is depend on a value of a previous file. like A(FILE NO) B C D 1 2 3 4 2 5 5 9(D1+C2)

So how does is it possible? I am new to this language so if there is another way to do this then please tell me.

4

1 回答 1

0

你真的应该使用 HeidiSQL 来创建和管理你的数据库,它更容易。然后你只需在 php 中创建一个带有 php 文件的链接。至于你的问题,是的,实际上很容易:

$id=0;//a counter to determine if you had inserted an item
if(isset($_POST['some_item'])){// when a value is set, like adding a new item to your database using the post method
   INSERT....//whatever you want
   $id=$_POST['id'];//the id of the item you just inserted ,which is also the counter
}
if($id!=0)
   //execute whatever code you want
于 2013-02-20T08:10:25.110 回答