Jump to content

save wordpres information in new database (using wp shortcodes)


Recommended Posts

hello every body :)

hop to have a good day :)

 

my friends I have a site based on wordpress that I get author id and post id by following codes : 
 

<؟php
echo (the_author_meta('ID') ); //author id

echo (get_post_field('ID'$post_id)) ;//post id
?>

 

now I want save this details in other data base but I cant :(

 

who know true Answer??

 

... by the way I must say that I try to save that details on new data base by this way : 

 

<?php 

$one  = the_author_meta('ID') ; 

$two = get_post_field('ID'$post_id)

$con = mysqli_connect('localhost','hm','123','user');

$res = mysqli_query($con,"insert into db (col1,col2)  values ('$one','$two') ");

?>

but not work  :(

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.