Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>i'm trying to make something like this</p> <pre><code> if (!empty($name) &amp;&amp; !empty($email) &amp;&amp; !empty($office_id) &amp;&amp; !empty($title) &amp;&amp; !empty($story)) { $save_sql = "INSERT INTO `tbl_contest` (filename, name, email, office_id, title, story, time) VALUES ('$img_newname','$name','$email','$office_id','$title','$story','$sql_date')"; $query = mysql_query($save_sql,$con) or die(mysql_error("Could not write information to the database")); if (mysql_num_rows($con) !== 0) { header('Location:' . $uploadSuccess.'#modal-text'); if($user_id) { // We have a user ID, so probably a logged in user. // If not, we'll get an exception, which we handle below. try { $ret_obj = $facebook-&gt;api('/me/feed', 'POST', array( 'link' =&gt; $post_link, 'message' =&gt; 'Posting with the PHP SDK!' )); echo '&lt;pre&gt;Post ID: ' . $ret_obj['id'] . '&lt;/pre&gt;'; // Give the user a logout link echo '&lt;br /&gt;&lt;a href="' . $facebook-&gt;getLogoutUrl() . '"&gt;logout&lt;/a&gt;'; } catch(FacebookApiException $e) { // If the user is logged out, you can have a // user ID even though the access token is invalid. // In this case, we'll get an exception, so we'll // just ask the user to login again here. $login_url = $facebook-&gt;getLoginUrl( array( 'scope' =&gt; 'publish_stream' )); echo 'Please &lt;a href="' . $login_url . '"&gt;login.&lt;/a&gt;'; error_log($e-&gt;getType()); error_log($e-&gt;getMessage()); } } else { // No user, so print a link for the user to login // To post to a user's wall, we need publish_stream permission // We'll use the current URL as the redirect_uri, so we don't // need to specify it here. $login_url = $facebook-&gt;getLoginUrl( array( 'scope' =&gt; 'publish_stream' ) ); echo 'Please &lt;a href="' . $login_url . '"&gt;login.&lt;/a&gt;'; } $get_id = $ret_obj['id']; $getid_sql = "INSERT INTO `tbl_contest` (post_id) VALUES ('$get_id')"; $getquery = mysql_query($getid_sql,$con) or die(mysql_error("Could not write information to the database")); } mysqli_close($con); } </code></pre> <p>i just added these 3 lines to the previous code:</p> <pre><code> $get_id = $ret_obj['id']; $getid_sql = "INSERT INTO `tbl_contest` (post_id) VALUES ('$get_id')"; $getquery = mysql_query($getid_sql,$con) or die(mysql_error("Could not write information to the database")); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload