Hi,
I am trying to update a database column through php but when I view the page in a browser the update doesn't seem to be running.
If I put the update sql in myphpadmin the update runs fine. What would be the reasons that this would happen?
I've included the code and db structure below:
<?php
$db=mysql_select_db($database_ginzagames, $ginzagames);
if (!$db)
{
echo 'Error: Could not connect to database. Please try again later.';
}
$query="SELECT * from javagames2";
$result = mysql_query($query);
if ($result)
echo ' You have successfully connected to the database.';
else
echo "Error: ".mysql_error();
$updating= "UPDATE javagames2 SET genre='Short' WHERE genre='Shoot'";
if ($updating)
echo ' You have successfully updated the database.';
else
echo "Error: ".mysql_error();
exit;
?>
CREATE TABLE javagames2 (
gameID int(11) NOT NULL auto_increment,
code int(11) NOT NULL default '0',
valid longtext NOT NULL,
name longtext NOT NULL,
genre longtext NOT NULL,
group longtext NOT NULL,
PRIMARY KEY (gameID)
) TYPE=MyISAM AUTO_INCREMENT=499 ;