Jump to content

Please Help!!! Update function not working!!@#@!?


gdure

What am I doing wrong????? - See code below!  

  1. 1. What am I doing wrong????? - See code below!

    • What is wrong with that code?
      0
    • Why is the UPDATE function not taking???
      0


Recommended Posts

<?

 

$db_name = 'interna1_loginmanager';

$db_hostname = 'localhost';

$db_username = 'interna1';

$db_password = 'gfd4647';

# Select database

 

 

$con = mysql_connect($db_hostname, $db_username, $db_password);

if (!$con) {

die ('Can\'t use database : ' . mysql_error());

}     

else{echo 'Connected successfully';

}

# Select database

$db_selected = mysql_select_db($db_name, $con);

if (!$db_selected) {

  die ('Can\'t use database : ' . mysql_error());

}

$res = mysql_query("SELECT * FROM globetrack") or die(mysql_error());

 

 

$v_gblcount=gblcount;

$v_afcount=afcount;

$v_Algcount=Algcount;

$v_Angcount=Angcount;

$v_country=Algeria;

 

 

 

 

switch ($v_country) {

    case Algeria:

        echo "<b><p>Country is Algeria</b></p>";

        $v_gblcount=gblcount+1;

        $v_afcount=afcount+1;

        $v_Algcount=Algcount+1;

        $v_continent=Africa;

        echo "<br>";

        break;

    case Angola:

        echo "Country is Angola";

        $v_gblcount=gblcount+1;

        $v_Angcount=Angcount+1;

        $v_continent=Africa;

        $v_afcount=afcount+1;

        echo "<br>";

        break;

    default:

        echo "Country not in Africa";

        break;

}

 

 

//mysql_query("UPDATE globetrack SET //(gblcount,afcount,Algcount,Angcount,continent) values

//('$v_gblcount','$v_afcount','$v_Algcount','$v_Angcount','$v_continent //')");

 

mysql_query("UPDATE globetrack SET (gblcount = '$v_gblcount', afcount = '$v_afcount', Algcount = '$v_Algcount', Angcount = '$v_Angcount', continent = '$v_continent'");

 

 

 

mysql_close($con);

 

?>

Link to comment
https://forums.phpfreaks.com/topic/67699-please-help-update-function-not-working/
Share on other sites

  • 3 weeks later...
  • 1 month later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.