Hello, I am adding content into wordpress database. On the database there are two columns They are: id (which is set to auto_increment) and guid. Guid contains url and has got the same value with id. Forexample id:1 guid: http://localhost/wordpress/?p=1 id:2 guid: http://localhost/wordpress/?p=2 What do i need to do to insert id and guid correctly into the database? Thanks
Well I don't have time to install WP and try it but it should be easy with the following script(only if you use the GET method): <?php $id = $_GET['p']; $url = "http://localhost/wordpress/?p=" . $id . ""; $insert = mysql_query("INSERT INTO links_table('id', 'guid') VALUES('" . $id . "', '" . $url . "')"); ?> PHP:
I got it working. I did this $query = "SELECT COUNT(*) as num FROM wp_posts"; $total_pages = mysql_fetch_array(mysql_query($query)); $total_pages = $total_pages[num]; $total_pages = $total_pages +1; PHP: