[thelist] php/mqSQL update format...

Nemesis nemesis at nemesis1.f2o.org
Sat Aug 16 12:16:48 CDT 2003


Tom Dell'Aringa wrote:

> Hi,
> 
> I think I have something wrong with my code to update my table as it
> is not working. I feel I have left something out.. Here is my query
> 
> $ud = mysql_query("
> 	UPDATE article SET articleTitle = '$aTitle' WHERE articleID =
> '$aid'");
> 
> if (!$ud) { $msg = "Update Failed: " . mysql_error();}
> 
> else { //success }
> 
> This doesn't update my table...does the mysql_query() actually run
> the query? ...
> 

I have to asume that $ud= $sql  and you have whatever you are using for 
$connection.

$sql = 	"UPDATE article SET articleTitle = '$aTitle'
WHERE articleID  ='$aid'";

result = mysql_query($sql, $connection) or die ("couldn't excute query);
if (! $result) {

echo "Update Failed";

}else(

echo"Success";
}

HTH
Gary
-- 
The Nemesis Project
http://nemesis1.f2o.org
One Stop CSS



More information about the thelist mailing list