Click here to Skip to main content
15,887,464 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, please I need help with this, i'm new to PHP I've been trying to figure out for over a week, an I've still found no answers.

I want to send out emails to the subscribers of my eBook. I want to include a link in the email, so when the link is clicked, the subscribers database will be updated.

When this link is clicked, the subscribers are redirected to my homepage.

So i'm having trouble with everything, from start to finish.

This is the code I've written so far:

<body>

<a href="" target="_blank">Click Here To Say YES!</a>

<?php

mysql_connect("localhost", "root", "");
mysql_select_db("rmn");

$sql = mysql_query("UPDATE subscribe SET confirmaton ='YES' WHERE email= [email]");




?>
</body> 



Thank you very much!
Posted

Check if this works :


$con=mysqli_connect("wwwwwwwwwww.com","any_name","passw","my_db");

// Check connection

if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
 
Share this answer
 
VB
function update_content($id, $page, $user_date) {

        global $db;

        // define sensible test values

        // create a prepared statement
        $update_stmt = $db->prepare('
            UPDATE
               pages
            SET
               blog_name =?,
               content = ?,
               update_date = ?
            WHERE
               id = ?
        ');

        /* bind parameters for markers */
        $update_stmt->bind_param('ssss', $page['blog_name'], $page['content'], $user_date, $id);

        /* execute query */
        $update_stmt->execute();

        /* close statement */
        $update_stmt->close();
    }
 
Share this answer
 
Comments
namo77 12-Mar-13 7:36am    
Thank you very much all! I solved it already. Thanks again.
mysql_connect("localhost", "root", "");
mysql_select_db("wrapper");

if(isset($_POST['update'])){
$UpdateQuery = "UPDATE articles_selection SET article = '$_POST[article]' WHERE id ='$_POST[hidden]'";
mysql_query($UpdateQuery);

};

$sql = mysql_query("SELECT * FROM articles_selection");

echo "<table border="1">
<tr>
<th>ID</th>
<th>ARTICLE</th>
</tr>";

while($record = mysql_fetch_array($sql)){
echo "<form action='index.php' method ='post'>";
echo "<tr>";
echo "<td>" . "<input type = 'text' name = 'id' value ="  . $record['id'] . " </td>";
echo "<td>" . "<input type = 'text' name = 'article' value ="  . $record['article'] .    " </td>";
echo "<td>" . "<input type = 'hidden' name = 'hidden' value ="  . $record['id'] . " </td>";
echo "<td>" . "<input class = 'field' type = 'submit' name = 'update' value = 'UPDATE'>" . " </td>";
echo "</tr>";
echo "</form>";
}
echo "</table>";

?>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900