.oO(AMoktar)
> I'm preparing a script ,
> consists of :
> -a user inserting page , into
users_ins table
> -an admin page do (show what users inserted , delete or
prove an inserting to
>be shown in index.php ),
> - and the index.php it shows the topics which was
inserted by users , and
>admin has proved them . from
proved_topic table
>
> --[the problem]:
> in the admin page :
> when i click on prove button , how can i send the row i
clicked into the
>
proved_topic table and delete it from
users_ins table
>
>
Why do you want to use two tables? Why not simply do it with
a single
table with an additional column for the status? Then the
admin can
easily approve or delete records from that table, and the
index page
would only show approved records. Nothing easier than that.
If you still want to do it with two tables, you have to use
two SQL
queries. The first one to copy the record from one table to
another
would be an INSERT with a nested SELECT (sub select), the
second one a
DELETE to remove the old record. Both queries should be
secured by a
transaction (depends on the used database if this is
possible) to keep
the tables in a consistent state, just in case something goes
wrong.
But as said - a single table would be much easier, more
reliable and a
better design.
Micha