Hi all...
I got this MYSql data base file that contains some values. Does anyone know the code to compare a certain value to the code, and of the value matches do something to the value inside the database, other wise continue. I tried the code below but it didnt work.
<?php
$name = $POST["name"];
$age = $POST["age"];
$prov = $_POST["provence"];
mysql_connect ("localhost") or
die ("could not connect to Database");
mysql_select_db("biz") or
die("could not find database");
$query = "insert into inof(name,age,prov) values ('$name','$age','$prov')";
mysql_query($query) or
die(mysql_error());
$result = mysql_query("select from inof") or
die (mysql_error());
while($row=mysql_fetch_array($result)){
//**********************************
// This is where I want to compare the vlaue
/////////////////////////////////////////////////////////
if ($row['age']=="41"){
$row['name']="someName";
echo "\n";
echo $row['name'],"\t",$row['age']. "<br>\n";
}
}
?>