copy a link to sql via php script
Posted: Thu Nov 11, 2010 7:16 am
Hi All,
Im trying to store a link in my sql database and for some reason it just will not update the Update field where the link should be.
Below is the code im using and I cannot figure out what I have done wrong for it not to update the sql database.
when it echo's the query it looks perfect to me but it will not update and im pulling my hair out, I Just know its going to be something silly that I have overlooked for the past hour.
Thanks
Adie
Im trying to store a link in my sql database and for some reason it just will not update the Update field where the link should be.
Below is the code im using and I cannot figure out what I have done wrong for it not to update the sql database.
Code: Select all
<?
$Number=$_GET['ID'];
$username="username";
$password="password";
$database="database";
mysql_connect(Localhost,$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$query="UPDATE nmbcdiary SET Update='http://nottinghammodelboatclub.freehostia.com/Admin/Editevent.php?ID=$Number' WHERE Number='$Number' ";
echo $query;
mysql_query($query);
echo "Link Updated";
?>
Thanks
Adie