gdure Posted September 2, 2007 Share Posted September 2, 2007 <? $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 More sharing options...
Hybride Posted September 19, 2007 Share Posted September 19, 2007 Because you made the UPDATE part a comment... take out the //. Link to comment https://forums.phpfreaks.com/topic/67699-please-help-update-function-not-working/#findComment-350828 Share on other sites More sharing options...
New Coder Posted October 19, 2007 Share Posted October 19, 2007 $mysql_query =" UPDATE globetrack SET gblcount = '$v_gblcount', afcount = '$v_afcount', Algcount = '$v_Algcount', Angcount = '$v_Angcount', continent = '$v_continent' "; Link to comment https://forums.phpfreaks.com/topic/67699-please-help-update-function-not-working/#findComment-373051 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.