Jump to content


Photo

editing mysql


  • Please log in to reply
1 reply to this topic

#1 samsbc12

samsbc12
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 26 May 2006 - 07:28 PM

<?
//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=************">


#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 26 May 2006 - 08:30 PM

Try to change this bit of code:
mysql_query($query) or die(mysql_error())
It will at least tell you what happened if the query fails.

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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users