Jump to content

Archived

This topic is now archived and is closed to further replies.

samsbc12

editing mysql

Recommended Posts

[code]<?
//Store username and pass
$username="*******";
$password="*******";
$database="*******";

//Variables
//Pulls From Form
$id=$_POST['id'];
$category=$_POST['category'];
$name=$_POST['name'];
$description=$_POST['description'];
$link=$_POST['link'];
$mirror=$_POST['mirror'];

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");

if($name != ""){

$query = "UPDATE links SET category='$category', name='$name', description='$description', link='$link',  mirror='$mirror' WHERE id='$id' ";

mysql_query($query);
mysql_close();
echo"<html>
<title>Addedt</title>
<style type=\"text/css\">
<!--
body {
    background-color: #666666;
}
-->
</style></head>

<body>
<div align=\"center\"><font color=\"#FFCC00\" face=\"Arial, Helvetica, sans-serif\">Record Updated. </font></div>
</body>
</html>
";



}?>
<meta http-equiv="refresh" content="2;URL=************">[/code]

Share this post


Link to post
Share on other sites
Try to change this bit of code:
[code]mysql_query($query) or die(mysql_error())[/code]
It will at least tell you what happened if the query fails.

Also, what happens ? Will it output the "Record Updated" page?

Share this post


Link to post
Share on other sites

×

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.