# PHP help

**URL:** <https://forum.kirupa.com/t/php-help/102779>\
**Category:** Uncategorized\
**Created:** [February 26, 2004, 10:45pm UTC](https://forum.kirupa.com/t/php-help/102779 "2004-02-26T22:45:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![imagined](https://avatars.discourse-cdn.com/v4/letter/i/a87d85/32.png) [@imagined](https://forum.kirupa.com/u/imagined)\
**Post date:** [February 26, 2004, 10:45pm UTC](https://forum.kirupa.com/t/php-help/102779/1 "2004-02-26T22:45:11Z")

</div>

I have 1 database: CONTENT

I have 2 tables inside the database:

1. APPROVE  
columns: ID, approve\_content, approve\_date

2. PUBLISHED  
columns: ID, published\_content, published\_date

i have a index page where you can see what’s inside the published\_content columns.

I want an admin page where you see all the content waiting to be approved. that content is inside the APPROVE table. i already have the script for that. then, i have a form where you input the ID of the approve\_content, when you select the ID, and click SUBMIT, the script is supposed to:

delete from APPROVE table and  
write it in the PUBLISHED table

my script erases from the APPROVE table but DOES NOT pass that data into the PUBLISHED table in the PUBLISHED\_CONTENT row.

how can i do that?

this is my script:

```
 &lt;p&gt;MANAGEMENT&lt;/p&gt;
 &lt;p&gt;
 
 &lt;form action="&lt;?=$_SERVER['PHP_SELF']?&gt;" method="post"&gt;
 &lt;p&gt;Approve: &lt;br /&gt;
 &lt;textarea name="publishedID" rows="1" cols="3" wrap&gt;
 &lt;/textarea&gt;&lt;br /&gt;
 &lt;input type="submit" name="published_go" value="submit" /&gt;
 &lt;/p&gt;&lt;/form&gt;&lt;/p&gt;

```

\<?php

if (isset($\_POST[published\_go]))  
{  
$publishedID = $\_POST[‘publishedID’];

$variable\_1 = “SELECT approve\_content FROM approve WHERE id = ‘$publishedID’”;  
$get\_data = mysql\_query($variable\_1);

if(!$get\_data)  
{  
echo “You keep on being stupid” . mysql\_error();  
exit;  
}

$row = mysql\_fetch\_assoc($get\_data);  
$curdate = ‘CURDATE()’;

$insert\_in\_DB = “INSERT INTO published SET  
published\_content = ‘$get\_data’,  
published\_date = ‘$curdate’”;  
$do\_insert = mysql\_query($insert\_in\_DB);

$delete\_from\_DB = “DELETE FROM approve WHERE id = ‘$publishedID’”;  
$do\_delete = mysql\_query($delete\_from\_DB);  
}

?\>

THANKS IN ADVANCE!  
:red:
