Jump to content

caraldur

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

caraldur's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Come on someone has to know how to fix this problem. I really need some help with it.
  2. I use Xampp, this installs PHP, MySQL, Apache, Filezilla, and Mercury. Great for developing websites locally before uploading the to a webserver. Here's the Link [a href=\"http://www.apachefriends.org/en/xampp-windows.html\" target=\"_blank\"]Xampp[/a]
  3. Could you post your code so we can have a look at it?
  4. I hate to keep bumping this up but I really need some help with this problem. -Fred
  5. $totalRows_getHex is returning a value of 1 This problem is has been driving me nuts because it should only loop once because one 1 result is being returned. Is there a better way to write this code so that it will work properly? -Fred
  6. Here is the query: [code] $colname_getHex ="Norwold"; if (isset($_GET['id'])) { $colname_getHex = (get_magic_quotes_gpc()) ? $_GET['id'] : addslashes($_GET['id']); } mysql_select_db($database_Norwold, $Norwold); $query_getHex = sprintf("SELECT * FROM hex_pool WHERE hex_pool.Dominion_Id = '%s'", $colname_getHex); $getHex = mysql_query($query_getHex, $Norwold) or die(mysql_error()); //$row_getHex = mysql_fetch_assoc($getHex);   $totalRows_getHex = mysql_num_rows($getHex); [/code] The problem is that I'm getting 2 identical inserts for one result for the above query. I understand there will be multiple inserts for multiple results from my query and that is what I want but 2 indential inserts forever result isn't.
  7. I really need help with this one, I know there has to be someone out there that can help me with this problem. Please give me a hand. thanks
  8. There can be multiple results of $getHex and if there is 2 records for each result are entered into the database.
  9. I have a while statement that inserts information into a DB when the page loads. The problem is that for some reason it inserts 2 records instead of just one. I'm not sure what is causing this problem but it's driving me nuts and I need some help. Here is my code: [code] while ($hex = mysql_fetch_array($getHex)) {   $hexid1= $hex['Hex_Id'];   $hextype1 = $hex['Hex_Type'];   $hexNumber1 = $hex['HexNumber'];   $hexgranted1 = $hex['Granted'];   $hexanimal1 = $hex['animal'];   $hexmineral1=$hex['mineral'];   $hexvegetable1=$hex['vegetable'];   $hexpop=$hex['Population'];   $hexdominion1=$hex['Dominion_Id'];   $totalhexpop = $totalhexpop + $hexpop;   //Total hex that will be added to the Total Dominion Population       $month = $row_getHistory['Month'];     $year = $row_getHistory['Year'];     $totalmonths = 12;     /////////////////////////////////////////////////////////     //Advances month by one unless month = 12 then it increases the years by one.     if($month == $totalmonths){     $month = 1;     $year = ($year +1);     }else{ $month = $month + 1; }     ////////////////////////////////////////////////////////////////   if($hexgranted[$i] ==1){$totalgranted = $totalgranted+1; }   $newpop = HexPopCal($hexpop);   $hexmonth1=$month;   $hexyear1=$year;    $hexinsert ="INSERT INTO historyhex (Hex_Id, Dominion_Id, HexNumber, HexType, animal, vegetable, mineral, Population, Month, Year)    VALUES ('$hexid1','$hexdominion1', '$hexNumber1', '$hextype1', '$hexanimal1', '$hexvegetable1', '$hexmineral1', '$newpop', '$hexmonth1', '$hexyear1')";       mysql_select_db($database_Norwold, $Norwold);    $Result1 = mysql_query($hexinsert, $Norwold) or die(mysql_error()); } [/code] I have searched the forums but I have found nothing that relates to my problem. Hopefully one of the gurus and help me out. Thanks
×
×
  • 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.