Jump to content

Recommended Posts

Hi,

 

I have a page called interest.php from where I insert variables $FROM and $TO to database. If it is successful, I want the values $FROM and $TO to be displayed in a table in another php file called interests_sent.php. How do I edit interests_sent.php file from interest.php file without using any url link or buttons.

 

interest.php

 

$sql = "INSERT INTO interests_sent(FROM,TO) values($FROM,$TO)";

$result = mysql_query($sql) or die("Query: " . $sql . "\n\n" . mysql_error());

 

how do I access interests_sent.php file here? Any ideas?

Your saving FORM and TO to the database, why don't you run a sql query in the interests_sent.php to retrieve these instead, eg

$sql = "SELECT FROM, TO FROM interests_sent ORDER DESC LIMIT 1";
$result = mysql_query($sql) or die("Query: " . $sql . "\n\n" . mysql_error());

list($FROM, $TO) = mysql_fetch_row($result);

echo $FROM . ' - ' . $TO;

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.